UNPKG

@lucidclient/elements

Version:

A lightweight, reactive UI library that bridges HTML and JavaScript through attributes, powered by SolidJS. Adds reactive state and dynamic behaviors to markup while maintaining simplicity.

1 lines 2.91 kB
{"version":3,"sources":["../src/core/constants.ts","../src/core/elements.ts","../src/helpers/build-handler-selector.ts"],"names":["C","constants_default","Elements","elements_default","buildHandlerSelector","namespace","specifier","action","baseSelector"],"mappings":"AAAA,qrBAAMA,CAAAA,CAAI,CACT,MAAA,CAAQ,YAAA,CACR,QAAA,CAAU,CACT,KAAA,CAAO,CAAA,CAAA,CACP,UAAA,CAAY,CACX,MAAA,CAAQ,OAAA,CACR,SAAA,CAAW,CACV,KAAA,CAAO,OAAA,CACP,GAAA,CAAK,KAAA,CACL,KAAA,CAAO,SAAA,CACP,IAAA,CAAM,QAAA,CACN,MAAA,CAAQ,QAAA,CACR,OAAA,CAAS,WAAA,CACT,IAAA,CAAM,MACP,CAAA,CACA,UAAA,CAAY,CACX,KAAA,CAAO,GAAA,CACP,OAAA,CAAS,GACV,CAAA,CACA,MAAA,CAAQ,CACP,MAAA,CAAQ,GAAA,CACR,KAAA,CAAO,GAAA,CACP,KAAA,CAAO,SAAA,CACP,MAAA,CAAQ,YACT,CACD,CAAA,CACA,SAAA,CAAW,EACZ,CACD,CAAA,CAEOC,CAAAA,aAAQD,CAAAA,CCxBf,IAAME,CAAAA,CAA6B,CAClC,OAAA,CAAS,CACR,KAAA,CAAOD,CAAAA,CAAE,QAAA,CAAS,KAAA,CAClB,UAAA,CAAYA,CAAAA,CAAE,QAAA,CAAS,UACxB,CAAA,CACA,OAAA,CAAS,CAAA,CAAA,CACT,QAAA,CAAU,IAAI,GAAA,CACd,MAAA,CAAQ,IAAI,GAAA,CACZ,YAAA,CAAc,IAAI,GAAA,CAClB,cAAA,CAAgB,IAAI,GACrB,CAAA,CAEOE,CAAAA,aAAQD,CAAAA,CCbf,IAAME,CAAAA,CAAuB,CAC5BC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CAAAA,EACI,CACJ,IAAMC,CAAAA,CAAe,CAAA,EAAA","file":"/Users/williamyallop/Documents/projects/protodigital/internal/lucid-client/packages/elements/dist/chunk-JAV2JQW5.cjs","sourcesContent":["const C = {\n\tprefix: \"[Elements]\",\n\tdefaults: {\n\t\tdebug: false,\n\t\tattributes: {\n\t\t\tprefix: \"data-\",\n\t\t\tselectors: {\n\t\t\t\tstore: \"store\",\n\t\t\t\tref: \"ref\",\n\t\t\t\tstate: \"state--\",\n\t\t\t\tbind: \"bind--\",\n\t\t\t\teffect: \"effect\",\n\t\t\t\thandler: \"handler--\",\n\t\t\t\tloop: \"loop\",\n\t\t\t},\n\t\t\tseperators: {\n\t\t\t\tscope: \":\",\n\t\t\t\thandler: \".\",\n\t\t\t},\n\t\t\tdenote: {\n\t\t\t\taction: \"@\",\n\t\t\t\tstate: \"$\",\n\t\t\t\tindex: \":index:\",\n\t\t\t\tindex1: \":indexOne:\",\n\t\t\t},\n\t\t},\n\t\tspecifier: \"\",\n\t},\n};\n\nexport default C;\n","import type { ElementsInstance } from \"../types/index.js\";\nimport C from \"./constants.js\";\n\n/**\n * Stores the state of the Elements library\n */\nconst Elements: ElementsInstance = {\n\toptions: {\n\t\tdebug: C.defaults.debug,\n\t\tattributes: C.defaults.attributes,\n\t},\n\tstarted: false,\n\thandlers: new Map(),\n\tstores: new Map(),\n\tstoreModules: new Map(),\n\tsyncedElements: new Map(),\n};\n\nexport default Elements;\n","import Elements from \"../core/elements.js\";\n\n/**\n * Creates a selector for a handler\n */\nconst buildHandlerSelector = (\n\tnamespace: string,\n\tspecifier: string,\n\taction: string,\n) => {\n\tconst baseSelector = `${Elements.options.attributes.prefix}${Elements.options.attributes.selectors.handler}${namespace}`;\n\n\tconst specifierPart =\n\t\tspecifier === \"\" ? \"\" : `\\\\.${specifier.replace(/\\./g, \"\\\\.\")}`;\n\n\treturn `[${baseSelector}${specifierPart}=\"${action}\"]`;\n};\n\nexport default buildHandlerSelector;\n"]}