@livenetworks/ashlar 1.6.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +641 -0
- package/README.md +190 -86
- package/{js → components}/COMPONENTS.md +1116 -1108
- package/{js → components}/index.js +81 -58
- package/{js → components}/ln-accordion/README.md +7 -6
- package/components/ln-accordion/ln-accordion-dev.scss +8 -0
- package/components/ln-accordion/ln-accordion.js +1 -0
- package/components/ln-accordion/ln-accordion.schema.json +30 -0
- package/components/ln-accordion/ln-accordion.scss +8 -0
- package/{js → components}/ln-accordion/src/ln-accordion.js +8 -2
- package/{js → components}/ln-ajax/README.md +171 -160
- package/components/ln-ajax/ln-ajax-dev.scss +8 -0
- package/components/ln-ajax/ln-ajax.js +1 -0
- package/components/ln-ajax/ln-ajax.schema.json +30 -0
- package/{js → components}/ln-ajax/src/ln-ajax.js +65 -30
- package/{js → components}/ln-api-connector/README.md +27 -5
- package/components/ln-api-connector/ln-api-connector.js +1 -0
- package/components/ln-api-connector/ln-api-connector.schema.json +96 -0
- package/components/ln-api-connector/src/connector-core.js +97 -0
- package/components/ln-api-connector/src/ln-api-connector.js +447 -0
- package/{js → components}/ln-api-queue/README.md +12 -9
- package/components/ln-api-queue/ln-api-queue.js +1 -0
- package/components/ln-api-queue/ln-api-queue.schema.json +34 -0
- package/{js → components}/ln-api-queue/src/ln-api-queue.js +33 -14
- package/{js → components}/ln-api-queue/src/queue-storage.js +7 -3
- package/{js → components}/ln-autoresize/README.md +129 -127
- package/components/ln-autoresize/ln-autoresize-dev.scss +8 -0
- package/components/ln-autoresize/ln-autoresize.js +1 -0
- package/components/ln-autoresize/ln-autoresize.schema.json +22 -0
- package/{js → components}/ln-autoresize/src/ln-autoresize.js +8 -1
- package/{js → components}/ln-autosave/README.md +127 -124
- package/components/ln-autosave/ln-autosave-dev.scss +13 -0
- package/components/ln-autosave/ln-autosave.js +1 -0
- package/components/ln-autosave/ln-autosave.schema.json +48 -0
- package/components/ln-autosave/src/autosave-model.js +34 -0
- package/{js → components}/ln-autosave/src/ln-autosave.js +65 -58
- package/components/ln-chart/README.md +145 -0
- package/components/ln-chart/ln-chart-dev.scss +20 -0
- package/components/ln-chart/ln-chart.js +1 -0
- package/components/ln-chart/ln-chart.schema.json +146 -0
- package/components/ln-chart/ln-chart.scss +8 -0
- package/components/ln-chart/src/chart-model.js +154 -0
- package/components/ln-chart/src/ln-chart.js +176 -0
- package/{js → components}/ln-circular-progress/README.md +15 -14
- package/components/ln-circular-progress/ln-circular-progress-dev.scss +8 -0
- package/components/ln-circular-progress/ln-circular-progress.js +1 -0
- package/components/ln-circular-progress/ln-circular-progress.schema.json +42 -0
- package/{js → components}/ln-circular-progress/src/ln-circular-progress.js +32 -50
- package/{js → components}/ln-confirm/README.md +69 -18
- package/components/ln-confirm/ln-confirm-dev.scss +24 -0
- package/components/ln-confirm/ln-confirm.js +1 -0
- package/components/ln-confirm/ln-confirm.schema.json +66 -0
- package/components/ln-confirm/ln-confirm.scss +24 -0
- package/{js → components}/ln-confirm/src/ln-confirm.js +180 -171
- package/{js → components}/ln-core/README.md +374 -149
- package/components/ln-core/attrs.js +273 -0
- package/components/ln-core/compare.js +40 -0
- package/components/ln-core/crypto.js +265 -0
- package/components/ln-core/date.js +50 -0
- package/components/ln-core/dom.js +115 -0
- package/components/ln-core/events.js +122 -0
- package/components/ln-core/form.js +136 -0
- package/{js → components}/ln-core/hash.js +149 -92
- package/components/ln-core/helpers.js +33 -0
- package/components/ln-core/http.js +48 -0
- package/components/ln-core/index.js +11 -0
- package/components/ln-core/lifecycle.js +403 -0
- package/components/ln-core/ln-core.schema.json +109 -0
- package/components/ln-core/locale.js +55 -0
- package/components/ln-core/matching.js +78 -0
- package/components/ln-core/number.js +125 -0
- package/components/ln-core/progress.js +30 -0
- package/components/ln-core/template.js +206 -0
- package/{js → components}/ln-core/window-cache.js +247 -213
- package/{js → components}/ln-couchdb-connector/README.md +7 -5
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -0
- package/components/ln-couchdb-connector/ln-couchdb-connector.schema.json +50 -0
- package/{js → components}/ln-couchdb-connector/src/ln-couchdb-connector.js +29 -43
- package/{js → components}/ln-data-coordinator/README.md +109 -73
- package/components/ln-data-coordinator/ln-data-coordinator-dev.scss +8 -0
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -0
- package/components/ln-data-coordinator/ln-data-coordinator.schema.json +196 -0
- package/components/ln-data-coordinator/src/data-read-policy.js +41 -0
- package/{js → components}/ln-data-coordinator/src/ln-data-coordinator.js +411 -154
- package/{js → components}/ln-data-coordinator/src/mutation-receipts.js +0 -5
- package/{js → components}/ln-data-store/README.md +42 -17
- package/components/ln-data-store/ln-data-store-dev.scss +13 -0
- package/components/ln-data-store/ln-data-store.js +1 -0
- package/components/ln-data-store/ln-data-store.schema.json +84 -0
- package/components/ln-data-store/src/data-store-model.js +155 -0
- package/{js → components}/ln-data-store/src/ln-data-store.js +407 -105
- package/components/ln-data-store/src/window-index.js +119 -0
- package/{js → components}/ln-date/README.md +17 -7
- package/{js → components}/ln-date/ln-date-dev.scss +14 -14
- package/components/ln-date/ln-date.js +1 -0
- package/components/ln-date/ln-date.schema.json +92 -0
- package/components/ln-date/src/date-model.js +186 -0
- package/components/ln-date/src/ln-date.js +486 -0
- package/components/ln-debug/README.md +132 -0
- package/components/ln-debug/ln-debug.js +1 -0
- package/components/ln-debug/ln-debug.schema.json +28 -0
- package/components/ln-debug/src/console-sink.js +19 -0
- package/components/ln-debug/src/debug-verifier.js +331 -0
- package/components/ln-debug/src/gate.js +95 -0
- package/components/ln-debug/src/generated-attributes.js +299 -0
- package/components/ln-debug/src/ln-debug.js +60 -0
- package/{js → components}/ln-dropdown/README.md +150 -140
- package/components/ln-dropdown/ln-dropdown-dev.scss +13 -0
- package/components/ln-dropdown/ln-dropdown.js +1 -0
- package/components/ln-dropdown/ln-dropdown.schema.json +90 -0
- package/components/ln-dropdown/ln-dropdown.scss +18 -0
- package/{js → components}/ln-dropdown/src/ln-dropdown.js +114 -11
- package/{js → components}/ln-editor/README.md +11 -9
- package/components/ln-editor/ln-editor-dev.scss +18 -0
- package/components/ln-editor/ln-editor.js +1 -0
- package/components/ln-editor/ln-editor.schema.json +58 -0
- package/components/ln-editor/ln-editor.scss +13 -0
- package/{js → components}/ln-editor/src/ln-editor.js +59 -11
- package/{js → components}/ln-external-links/README.md +10 -8
- package/components/ln-external-links/ln-external-links.js +1 -0
- package/components/ln-external-links/ln-external-links.schema.json +18 -0
- package/{js → components}/ln-external-links/src/ln-external-links.js +13 -11
- package/{js → components}/ln-fill/README.md +6 -8
- package/components/ln-fill/ln-fill.js +1 -0
- package/components/ln-fill/ln-fill.schema.json +23 -0
- package/{js → components}/ln-fill/src/ln-fill.js +7 -1
- package/components/ln-filter/README.md +131 -0
- package/components/ln-filter/ln-filter-dev.scss +13 -0
- package/components/ln-filter/ln-filter.js +1 -0
- package/components/ln-filter/ln-filter.schema.json +153 -0
- package/components/ln-filter/src/filter-model.js +185 -0
- package/components/ln-filter/src/ln-filter.js +435 -0
- package/{js → components}/ln-form/README.md +260 -264
- package/components/ln-form/ln-form-dev.scss +8 -0
- package/components/ln-form/ln-form.js +1 -0
- package/components/ln-form/ln-form.schema.json +45 -0
- package/{js → components}/ln-form/src/ln-form.js +107 -99
- package/{js → components}/ln-http/README.md +11 -6
- package/components/ln-http/ln-http.js +1 -0
- package/components/ln-http/ln-http.schema.json +6 -0
- package/components/ln-http/src/http-core.js +51 -0
- package/{js → components}/ln-http/src/ln-http.js +28 -33
- package/{js → components}/ln-icon/README.md +16 -9
- package/components/ln-icon/ln-icon.schema.json +6 -0
- package/components/ln-include/README.md +75 -0
- package/components/ln-include/ln-include-dev.scss +13 -0
- package/components/ln-include/ln-include.js +1 -0
- package/components/ln-include/ln-include.schema.json +23 -0
- package/components/ln-include/src/ln-include.js +111 -0
- package/components/ln-key/README.md +130 -0
- package/components/ln-key/ln-key-dev.scss +18 -0
- package/components/ln-key/ln-key.js +1 -0
- package/components/ln-key/ln-key.schema.json +56 -0
- package/components/ln-key/src/key-model.js +146 -0
- package/components/ln-key/src/ln-key.js +201 -0
- package/{js → components}/ln-link/README.md +7 -9
- package/components/ln-link/ln-link-dev.scss +8 -0
- package/components/ln-link/ln-link.js +1 -0
- package/components/ln-link/ln-link.schema.json +22 -0
- package/{js → components}/ln-link/src/ln-link.js +16 -11
- package/components/ln-list/README.md +152 -0
- package/components/ln-list/ln-list-dev.scss +8 -0
- package/components/ln-list/ln-list.js +1 -0
- package/components/ln-list/ln-list.schema.json +166 -0
- package/components/ln-list/ln-list.scss +25 -0
- package/{js → components}/ln-list/src/ln-list.js +1301 -1216
- package/{js → components}/ln-modal/README.md +13 -10
- package/components/ln-modal/ln-modal-dev.scss +18 -0
- package/components/ln-modal/ln-modal.js +1 -0
- package/components/ln-modal/ln-modal.schema.json +54 -0
- package/components/ln-modal/ln-modal.scss +51 -0
- package/{js → components}/ln-modal/src/ln-modal.js +164 -137
- package/{js → components}/ln-nav/README.md +11 -11
- package/components/ln-nav/ln-nav.js +1 -0
- package/components/ln-nav/ln-nav.schema.json +25 -0
- package/{js → components}/ln-nav/src/ln-nav.js +25 -14
- package/components/ln-number/README.md +205 -0
- package/{js → components}/ln-number/ln-number-dev.scss +13 -13
- package/components/ln-number/ln-number.js +1 -0
- package/components/ln-number/ln-number.schema.json +63 -0
- package/components/ln-number/src/ln-number.js +400 -0
- package/components/ln-number/src/number-model.js +31 -0
- package/components/ln-obfuscator/README.md +60 -0
- package/components/ln-obfuscator/ln-obfuscator.js +1 -0
- package/components/ln-obfuscator/ln-obfuscator.schema.json +49 -0
- package/components/ln-obfuscator/src/ln-obfuscator.js +159 -0
- package/components/ln-obfuscator/src/obfuscator-model.js +250 -0
- package/{js → components}/ln-options/README.md +3 -1
- package/components/ln-options/ln-options-dev.scss +13 -0
- package/components/ln-options/ln-options.js +1 -0
- package/components/ln-options/ln-options.schema.json +41 -0
- package/{js → components}/ln-options/src/ln-options.js +13 -5
- package/components/ln-persist/README.md +151 -0
- package/components/ln-persist/ln-persist.js +1 -0
- package/components/ln-persist/ln-persist.schema.json +28 -0
- package/components/ln-persist/src/ln-persist.js +83 -0
- package/components/ln-picklist/README.md +230 -0
- package/components/ln-picklist/ln-picklist-dev.scss +22 -0
- package/components/ln-picklist/ln-picklist.js +1 -0
- package/components/ln-picklist/ln-picklist.schema.json +49 -0
- package/components/ln-picklist/src/ln-picklist.js +228 -0
- package/{js → components}/ln-popover/README.md +164 -162
- package/components/ln-popover/ln-popover-dev.scss +13 -0
- package/components/ln-popover/ln-popover.js +1 -0
- package/components/ln-popover/ln-popover.schema.json +82 -0
- package/components/ln-popover/ln-popover.scss +18 -0
- package/{js → components}/ln-popover/src/ln-popover.js +42 -36
- package/{js → components}/ln-progress/README.md +410 -413
- package/components/ln-progress/ln-progress-dev.scss +8 -0
- package/components/ln-progress/ln-progress.js +1 -0
- package/components/ln-progress/ln-progress.schema.json +40 -0
- package/components/ln-progress/src/ln-progress.js +91 -0
- package/components/ln-progress/src/progress-model.js +20 -0
- package/{js → components}/ln-router/README.md +443 -432
- package/components/ln-router/ln-router-dev.scss +13 -0
- package/components/ln-router/ln-router.js +1 -0
- package/components/ln-router/ln-router.schema.json +68 -0
- package/{js → components}/ln-router/src/ln-router.js +585 -539
- package/components/ln-router/src/router-model.js +50 -0
- package/components/ln-scroll/README.md +45 -0
- package/components/ln-scroll/ln-scroll.js +1 -0
- package/components/ln-scroll/ln-scroll.schema.json +85 -0
- package/components/ln-scroll/src/ln-scroll.js +150 -0
- package/components/ln-search/README.md +188 -0
- package/components/ln-search/ln-search-dev.scss +13 -0
- package/components/ln-search/ln-search.js +1 -0
- package/components/ln-search/ln-search.schema.json +103 -0
- package/components/ln-search/src/ln-search.js +330 -0
- package/{js → components}/ln-slug/README.md +6 -3
- package/components/ln-slug/ln-slug-dev.scss +18 -0
- package/components/ln-slug/ln-slug.js +1 -0
- package/components/ln-slug/ln-slug.schema.json +23 -0
- package/{js → components}/ln-slug/src/ln-slug.js +20 -13
- package/components/ln-slug/src/slug-model.js +21 -0
- package/{js → components}/ln-sort/README.md +178 -170
- package/{js → components}/ln-sort/ln-sort-dev.scss +8 -8
- package/components/ln-sort/ln-sort.js +1 -0
- package/components/ln-sort/ln-sort.schema.json +104 -0
- package/components/ln-sort/src/ln-sort.js +321 -0
- package/components/ln-sort/src/sort-model.js +117 -0
- package/{js → components}/ln-sortable/README.md +7 -11
- package/components/ln-sortable/ln-sortable-dev.scss +13 -0
- package/components/ln-sortable/ln-sortable.js +1 -0
- package/components/ln-sortable/ln-sortable.schema.json +36 -0
- package/{js → components}/ln-sortable/src/ln-sortable.js +8 -13
- package/{js → components}/ln-stat/README.md +3 -1
- package/components/ln-stat/ln-stat-dev.scss +8 -0
- package/components/ln-stat/ln-stat.js +1 -0
- package/components/ln-stat/ln-stat.schema.json +32 -0
- package/{js → components}/ln-stat/src/ln-stat.js +14 -18
- package/components/ln-stat/src/stat-model.js +28 -0
- package/{js → components}/ln-table/README.md +37 -24
- package/{js → components}/ln-table/ln-table-dev.scss +17 -17
- package/components/ln-table/ln-table.js +1 -0
- package/components/ln-table/ln-table.schema.json +211 -0
- package/components/ln-table/ln-table.scss +15 -0
- package/{js → components}/ln-table/src/ln-table.js +1365 -1493
- package/components/ln-table/src/table-model.js +98 -0
- package/components/ln-table-coordinator/README.md +61 -0
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -0
- package/components/ln-table-coordinator/ln-table-coordinator.schema.json +93 -0
- package/components/ln-table-coordinator/src/ln-table-coordinator.js +193 -0
- package/{js → components}/ln-tabs/README.md +32 -14
- package/components/ln-tabs/ln-tabs-dev.scss +24 -0
- package/components/ln-tabs/ln-tabs.js +1 -0
- package/components/ln-tabs/ln-tabs.schema.json +75 -0
- package/components/ln-tabs/ln-tabs.scss +8 -0
- package/components/ln-tabs/src/ln-tabs.js +207 -0
- package/components/ln-tabs/src/tabs-model.js +82 -0
- package/{js → components}/ln-time/README.md +96 -95
- package/components/ln-time/ln-time-dev.scss +13 -0
- package/components/ln-time/ln-time.js +1 -0
- package/components/ln-time/ln-time.schema.json +38 -0
- package/{js → components}/ln-time/src/ln-time.js +206 -223
- package/components/ln-time/src/time-model.js +64 -0
- package/{js → components}/ln-toast/README.md +23 -5
- package/components/ln-toast/ln-toast-dev.scss +8 -0
- package/components/ln-toast/ln-toast.js +1 -0
- package/components/ln-toast/ln-toast.schema.json +65 -0
- package/components/ln-toast/ln-toast.scss +59 -0
- package/{js → components}/ln-toast/src/ln-toast.js +233 -232
- package/{js → components}/ln-toggle/README.md +198 -196
- package/{js → components}/ln-toggle/ln-toggle-dev.scss +13 -13
- package/components/ln-toggle/ln-toggle.js +1 -0
- package/components/ln-toggle/ln-toggle.schema.json +52 -0
- package/components/ln-toggle/ln-toggle.scss +37 -0
- package/{js → components}/ln-toggle/src/ln-toggle.js +61 -46
- package/{js → components}/ln-tooltip/README.md +6 -6
- package/{js → components}/ln-tooltip/ln-tooltip-dev.scss +9 -9
- package/components/ln-tooltip/ln-tooltip.js +1 -0
- package/components/ln-tooltip/ln-tooltip.schema.json +86 -0
- package/components/ln-tooltip/ln-tooltip.scss +9 -0
- package/{js → components}/ln-tooltip/src/ln-tooltip.js +14 -3
- package/{js → components}/ln-translations/README.md +3 -1
- package/components/ln-translations/ln-translations-dev.scss +13 -0
- package/components/ln-translations/ln-translations.js +1 -0
- package/components/ln-translations/ln-translations.schema.json +120 -0
- package/{js → components}/ln-translations/src/ln-translations.js +25 -10
- package/components/ln-ui-coordinator/README.md +101 -0
- package/components/ln-ui-coordinator/ln-ui-coordinator-dev.scss +8 -0
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -0
- package/components/ln-ui-coordinator/ln-ui-coordinator.schema.json +60 -0
- package/{js/ln-modal-coordinator/src/ln-modal-coordinator.js → components/ln-ui-coordinator/src/ln-ui-coordinator.js} +403 -345
- package/components/ln-upload/README.md +133 -0
- package/components/ln-upload/ln-upload-dev.scss +18 -0
- package/components/ln-upload/ln-upload.js +1 -0
- package/components/ln-upload/ln-upload.schema.json +193 -0
- package/components/ln-upload/ln-upload.scss +20 -0
- package/components/ln-upload/src/ln-upload.js +652 -0
- package/components/ln-upload/src/upload-model.js +78 -0
- package/{js → components}/ln-validate/README.md +182 -180
- package/{js → components}/ln-validate/ln-validate-dev.scss +15 -15
- package/components/ln-validate/ln-validate.js +1 -0
- package/components/ln-validate/ln-validate.schema.json +50 -0
- package/components/ln-validate/ln-validate.scss +7 -0
- package/{js → components}/ln-validate/src/ln-validate.js +23 -45
- package/components/ln-validate/src/validate-model.js +64 -0
- package/components/ln-websocket-connector/README.md +166 -0
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -0
- package/components/ln-websocket-connector/ln-websocket-connector.schema.json +29 -0
- package/components/ln-websocket-connector/src/ln-websocket-connector.js +279 -0
- package/ln-ashlar.html-data.json +1796 -0
- package/package.json +84 -61
- package/{scss → theme}/base/_global.scss +1 -2
- package/{scss → theme}/base/_reset.scss +1 -1
- package/{scss → theme}/base/_typography.scss +2 -0
- package/theme/brand.css +73 -0
- package/{scss → theme}/components/_app-shell.scss +8 -0
- package/theme/components/_button.scss +24 -0
- package/theme/components/_chart.scss +5 -0
- package/theme/components/_confirm.scss +6 -0
- package/{scss → theme}/components/_date.scss +30 -22
- package/{scss → theme}/components/_dropdown.scss +6 -1
- package/theme/components/_form.scss +140 -0
- package/{scss → theme}/components/_layout.scss +6 -0
- package/{scss → theme}/components/_ln-table.scss +1 -6
- package/theme/components/_picklist.scss +3 -0
- package/{scss → theme}/components/_sort.scss +10 -10
- package/theme/components/_status-badge.scss +6 -0
- package/{scss → theme}/components/_table.scss +16 -0
- package/{scss → theme}/components/_tabs.scss +0 -4
- package/theme/components/_toast.scss +48 -0
- package/{scss → theme}/components/_toggle.scss +1 -1
- package/theme/components/_upload.scss +45 -0
- package/{scss → theme}/config/_breakpoints.scss +1 -1
- package/theme/config/_contrast.scss +128 -0
- package/{scss → theme}/config/_density.scss +191 -205
- package/theme/config/_palette.scss +274 -0
- package/theme/config/_theme.scss +293 -0
- package/{scss → theme}/config/_tokens.scss +285 -441
- package/{scss → theme}/config/mixins/_accordion.scss +1 -1
- package/{scss → theme}/config/mixins/_alert.scss +1 -0
- package/{scss → theme}/config/mixins/_app-shell.scss +4 -2
- package/{scss → theme}/config/mixins/_borders.scss +2 -0
- package/theme/config/mixins/_btn.scss +175 -0
- package/{scss → theme}/config/mixins/_card.scss +55 -46
- package/theme/config/mixins/_chart.scss +82 -0
- package/{scss → theme}/config/mixins/_collapsible.scss +2 -1
- package/{scss → theme}/config/mixins/_colors.scss +8 -14
- package/{scss → theme}/config/mixins/_diagnostics.scss +48 -48
- package/theme/config/mixins/_dropdown.scss +169 -0
- package/{scss → theme}/config/mixins/_editor.scss +0 -7
- package/{scss → theme}/config/mixins/_filter.scss +47 -47
- package/{scss → theme}/config/mixins/_footer.scss +1 -1
- package/{scss → theme}/config/mixins/_form.scss +49 -18
- package/{scss → theme}/config/mixins/_index.scss +62 -61
- package/{scss → theme}/config/mixins/_layout.scss +6 -2
- package/{scss → theme}/config/mixins/_ln-table.scss +31 -10
- package/{scss → theme}/config/mixins/_loader.scss +1 -1
- package/{scss → theme}/config/mixins/_modal.scss +145 -149
- package/{scss → theme}/config/mixins/_motion.scss +13 -0
- package/{scss → theme}/config/mixins/_nav.scss +7 -7
- package/theme/config/mixins/_picklist.scss +66 -0
- package/theme/config/mixins/_popover.scss +96 -0
- package/{scss → theme}/config/mixins/_sidebar.scss +7 -4
- package/{scss → theme}/config/mixins/_sort.scss +43 -42
- package/{scss → theme}/config/mixins/_status-badge.scss +15 -2
- package/{scss → theme}/config/mixins/_table.scss +25 -14
- package/{scss → theme}/config/mixins/_tabs.scss +1 -1
- package/{scss → theme}/config/mixins/_toast.scss +174 -179
- package/{scss → theme}/config/mixins/_tooltip.scss +2 -2
- package/{scss → theme}/config/mixins/_typography.scss +16 -5
- package/{scss → theme}/config/mixins/_upload.scss +8 -6
- package/theme/ln-ashlar-core.scss +24 -0
- package/theme/ln-ashlar-dev.scss +66 -0
- package/theme/ln-ashlar-landing.scss +56 -0
- package/{scss/ln-ashlar.scss → theme/ln-ashlar-theme.scss} +63 -69
- package/theme/ln-ashlar.scss +8 -0
- package/theme/presentation/_bento.scss +151 -0
- package/theme/presentation/_cta.scss +111 -0
- package/theme/presentation/_effects.scss +216 -0
- package/theme/presentation/_features.scss +108 -0
- package/theme/presentation/_footer.scss +129 -0
- package/theme/presentation/_hero.scss +158 -0
- package/theme/presentation/_layout.scss +170 -0
- package/theme/presentation/_navbar.scss +140 -0
- package/theme/presentation/_pricing.scss +262 -0
- package/theme/presentation/_stats.scss +87 -0
- package/theme/presentation/_testimonials.scss +124 -0
- package/theme/presentation/_tokens.scss +39 -0
- package/theme/presentation/_typography.scss +163 -0
- package/{scss → theme}/utilities/_animations.scss +38 -0
- package/{scss → theme}/utilities/_utilities.scss +6 -0
- package/web-types.json +2312 -0
- package/js/ln-accordion/ln-accordion.js +0 -1
- package/js/ln-ajax/ln-ajax.js +0 -1
- package/js/ln-api-connector/ln-api-connector.js +0 -1
- package/js/ln-api-connector/src/ln-api-connector.js +0 -368
- package/js/ln-api-queue/ln-api-queue.js +0 -1
- package/js/ln-autoresize/ln-autoresize.js +0 -1
- package/js/ln-autosave/ln-autosave.js +0 -1
- package/js/ln-circular-progress/ln-circular-progress.js +0 -1
- package/js/ln-confirm/_ln-confirm.scss +0 -24
- package/js/ln-confirm/ln-confirm.js +0 -1
- package/js/ln-core/crypto.js +0 -83
- package/js/ln-core/helpers.js +0 -788
- package/js/ln-core/index.js +0 -7
- package/js/ln-core/persist.js +0 -97
- package/js/ln-couchdb-connector/ln-couchdb-connector.js +0 -1
- package/js/ln-data-coordinator/ln-data-coordinator.js +0 -1
- package/js/ln-data-coordinator/src/data-read-policy.js +0 -18
- package/js/ln-data-store/ln-data-store.js +0 -1
- package/js/ln-date/ln-date.js +0 -1
- package/js/ln-date/src/ln-date.js +0 -603
- package/js/ln-debug/README.md +0 -58
- package/js/ln-debug/ln-debug.js +0 -1
- package/js/ln-debug/src/ln-debug.js +0 -19
- package/js/ln-dropdown/ln-dropdown.js +0 -1
- package/js/ln-dropdown/ln-dropdown.scss +0 -15
- package/js/ln-editor/ln-editor.js +0 -1
- package/js/ln-editor/ln-editor.scss +0 -43
- package/js/ln-external-links/ln-external-links.js +0 -1
- package/js/ln-fill/ln-fill.js +0 -1
- package/js/ln-filter/README.md +0 -189
- package/js/ln-filter/ln-filter-dev.scss +0 -8
- package/js/ln-filter/ln-filter.js +0 -1
- package/js/ln-filter/src/ln-filter.js +0 -419
- package/js/ln-form/ln-form.js +0 -1
- package/js/ln-http/ln-http.js +0 -1
- package/js/ln-link/ln-link.js +0 -1
- package/js/ln-list/README.md +0 -129
- package/js/ln-list/ln-list.js +0 -1
- package/js/ln-list/ln-list.scss +0 -28
- package/js/ln-modal/ln-modal-dev.scss +0 -13
- package/js/ln-modal/ln-modal.js +0 -1
- package/js/ln-modal/ln-modal.scss +0 -35
- package/js/ln-modal-coordinator/README.md +0 -99
- package/js/ln-modal-coordinator/ln-modal-coordinator-dev.scss +0 -8
- package/js/ln-modal-coordinator/ln-modal-coordinator.js +0 -1
- package/js/ln-nav/ln-nav.js +0 -1
- package/js/ln-number/README.md +0 -149
- package/js/ln-number/ln-number.js +0 -1
- package/js/ln-number/src/ln-number.js +0 -443
- package/js/ln-options/ln-options.js +0 -1
- package/js/ln-popover/ln-popover.js +0 -1
- package/js/ln-progress/ln-progress.js +0 -1
- package/js/ln-progress/src/ln-progress.js +0 -98
- package/js/ln-router/ln-router.js +0 -1
- package/js/ln-search/README.md +0 -158
- package/js/ln-search/ln-search-dev.scss +0 -8
- package/js/ln-search/ln-search.js +0 -1
- package/js/ln-search/src/ln-search.js +0 -117
- package/js/ln-slug/ln-slug.js +0 -1
- package/js/ln-sort/ln-sort.js +0 -1
- package/js/ln-sort/src/ln-sort.js +0 -178
- package/js/ln-sortable/ln-sortable.js +0 -1
- package/js/ln-stat/ln-stat.js +0 -1
- package/js/ln-table/ln-table.js +0 -1
- package/js/ln-table/ln-table.scss +0 -11
- package/js/ln-table-coordinator/README.md +0 -73
- package/js/ln-table-coordinator/ln-table-coordinator.js +0 -1
- package/js/ln-table-coordinator/src/ln-table-coordinator.js +0 -160
- package/js/ln-tabs/ln-tabs-dev.scss +0 -18
- package/js/ln-tabs/ln-tabs.js +0 -1
- package/js/ln-tabs/src/ln-tabs.js +0 -188
- package/js/ln-time/ln-time.js +0 -1
- package/js/ln-toast/ln-toast.js +0 -1
- package/js/ln-toggle/ln-toggle.js +0 -1
- package/js/ln-tooltip/ln-tooltip.js +0 -1
- package/js/ln-tooltip/ln-tooltip.scss +0 -9
- package/js/ln-translations/ln-translations.js +0 -1
- package/js/ln-upload/README.md +0 -255
- package/js/ln-upload/ln-upload.js +0 -1
- package/js/ln-upload/ln-upload.scss +0 -20
- package/js/ln-upload/src/ln-upload.js +0 -423
- package/js/ln-validate/ln-validate.js +0 -1
- package/scss/components/_button.scss +0 -20
- package/scss/components/_confirm.scss +0 -5
- package/scss/components/_form.scss +0 -107
- package/scss/components/_status-badge.scss +0 -4
- package/scss/components/_toast.scss +0 -68
- package/scss/components/_upload.scss +0 -51
- package/scss/config/_theme.scss +0 -216
- package/scss/config/mixins/_btn.scss +0 -179
- package/scss/config/mixins/_confirm.scss +0 -31
- package/scss/config/mixins/_dropdown.scss +0 -141
- package/scss/config/mixins/_popover.scss +0 -64
- package/scss/ln-ashlar-dev.scss +0 -39
- /package/{js → components}/ln-core/positioning.js +0 -0
- /package/{js → components}/ln-core/reactive.js +0 -0
- /package/{js → components}/ln-filter/ln-filter.scss +0 -0
- /package/{js → components}/ln-icon/ln-icon.js +0 -0
- /package/{js → components}/ln-icon/src/ln-icon.js +0 -0
- /package/{js → components}/ln-search/ln-search.scss +0 -0
- /package/{js → components}/ln-toast/template.html +0 -0
- /package/{scss → theme}/components/_accordion.scss +0 -0
- /package/{scss → theme}/components/_ajax.scss +0 -0
- /package/{scss → theme}/components/_alert.scss +0 -0
- /package/{scss → theme}/components/_avatar.scss +0 -0
- /package/{scss → theme}/components/_breadcrumbs.scss +0 -0
- /package/{scss → theme}/components/_card.scss +0 -0
- /package/{scss → theme}/components/_chip.scss +0 -0
- /package/{scss → theme}/components/_circular-progress.scss +0 -0
- /package/{scss → theme}/components/_editor.scss +0 -0
- /package/{scss → theme}/components/_empty-state.scss +0 -0
- /package/{scss → theme}/components/_filter.scss +0 -0
- /package/{scss → theme}/components/_link.scss +0 -0
- /package/{scss → theme}/components/_loader.scss +0 -0
- /package/{scss → theme}/components/_modal.scss +0 -0
- /package/{scss → theme}/components/_nav.scss +0 -0
- /package/{scss → theme}/components/_page-header.scss +0 -0
- /package/{scss → theme}/components/_popover.scss +0 -0
- /package/{scss → theme}/components/_progress.scss +0 -0
- /package/{scss → theme}/components/_prose.scss +0 -0
- /package/{scss → theme}/components/_scrollbar.scss +0 -0
- /package/{scss → theme}/components/_sections.scss +0 -0
- /package/{scss → theme}/components/_sidebar.scss +0 -0
- /package/{scss → theme}/components/_stat-card.scss +0 -0
- /package/{scss → theme}/components/_stepper.scss +0 -0
- /package/{scss → theme}/components/_timeline.scss +0 -0
- /package/{scss → theme}/components/_tooltip.scss +0 -0
- /package/{scss → theme}/components/_translations.scss +0 -0
- /package/{scss → theme}/config/_icons.scss +0 -0
- /package/{scss → theme}/config/_mixins.scss +0 -0
- /package/{scss → theme}/config/mixins/_ajax.scss +0 -0
- /package/{scss → theme}/config/mixins/_avatar.scss +0 -0
- /package/{scss → theme}/config/mixins/_breadcrumbs.scss +0 -0
- /package/{scss → theme}/config/mixins/_breakpoints.scss +0 -0
- /package/{scss → theme}/config/mixins/_chip.scss +0 -0
- /package/{scss → theme}/config/mixins/_circular-progress.scss +0 -0
- /package/{scss → theme}/config/mixins/_display.scss +0 -0
- /package/{scss → theme}/config/mixins/_empty-state.scss +0 -0
- /package/{scss → theme}/config/mixins/_focus.scss +0 -0
- /package/{scss → theme}/config/mixins/_interaction.scss +0 -0
- /package/{scss → theme}/config/mixins/_kbd.scss +0 -0
- /package/{scss → theme}/config/mixins/_link.scss +0 -0
- /package/{scss → theme}/config/mixins/_page-header.scss +0 -0
- /package/{scss → theme}/config/mixins/_position.scss +0 -0
- /package/{scss → theme}/config/mixins/_progress.scss +0 -0
- /package/{scss → theme}/config/mixins/_prose.scss +0 -0
- /package/{scss → theme}/config/mixins/_shadows.scss +0 -0
- /package/{scss → theme}/config/mixins/_sizing.scss +0 -0
- /package/{scss → theme}/config/mixins/_spacing.scss +0 -0
- /package/{scss → theme}/config/mixins/_stat-card.scss +0 -0
- /package/{scss → theme}/config/mixins/_stepper.scss +0 -0
- /package/{scss → theme}/config/mixins/_timeline.scss +0 -0
- /package/{scss → theme}/config/mixins/_transitions.scss +0 -0
- /package/{scss → theme}/config/mixins/_translations.scss +0 -0
- /package/{scss → theme}/tabler-icons.txt +0 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { dispatch, registerComponent } from '../../ln-core';
|
|
2
|
+
import {
|
|
3
|
+
obfuscate,
|
|
4
|
+
deobfuscate,
|
|
5
|
+
utf8ToBase64,
|
|
6
|
+
base64ToUtf8,
|
|
7
|
+
xorObfuscate,
|
|
8
|
+
xorDeobfuscate
|
|
9
|
+
} from './obfuscator-model.js';
|
|
10
|
+
|
|
11
|
+
(function () {
|
|
12
|
+
const DOM_SELECTOR = 'data-ln-obfuscator';
|
|
13
|
+
const DOM_ATTRIBUTE = 'lnObfuscator';
|
|
14
|
+
|
|
15
|
+
if (window[DOM_ATTRIBUTE] !== undefined) return;
|
|
16
|
+
|
|
17
|
+
function _syncAttribute(el) {
|
|
18
|
+
const inst = el[DOM_ATTRIBUTE];
|
|
19
|
+
if (!inst) return;
|
|
20
|
+
inst.deobfuscate();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// ─── Attribute Contract (SSOT) ──────────────────────────
|
|
24
|
+
const ATTRIBUTES = {
|
|
25
|
+
'data-ln-obfuscator': { type: 'enum', values: ['rot13', 'base64', 'xor'], fallback: 'rot13', effect: _syncAttribute, description: 'Codec used to deobfuscate text or links' },
|
|
26
|
+
'data-ln-obfuscator-codec': { type: 'enum', values: ['rot13', 'base64', 'xor'], fallback: 'rot13', effect: _syncAttribute, description: 'Explicit codec override attribute' },
|
|
27
|
+
'data-ln-obfuscator-key': { type: 'string', effect: _syncAttribute, description: 'Encryption or masking key for XOR codec' }
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// ─── Component Constructor ───────────────────────────────
|
|
31
|
+
function _component(dom) {
|
|
32
|
+
if (dom[DOM_ATTRIBUTE]) return dom[DOM_ATTRIBUTE];
|
|
33
|
+
dom[DOM_ATTRIBUTE] = this;
|
|
34
|
+
this.dom = dom;
|
|
35
|
+
this._originalTextNodes = null;
|
|
36
|
+
this._originalHref = null;
|
|
37
|
+
|
|
38
|
+
this.deobfuscate();
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// ─── Core Deobfuscation Logic ────────────────────────────
|
|
43
|
+
_component.prototype.deobfuscate = function () {
|
|
44
|
+
const isLink = Boolean(this.dom.matches && (this.dom.matches('a') || this.dom.matches('area')));
|
|
45
|
+
|
|
46
|
+
// Capture initial raw href before first mutation
|
|
47
|
+
if (this._originalHref === null && isLink && this.dom.hasAttribute('href')) {
|
|
48
|
+
this._originalHref = this.dom.getAttribute('href');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Capture initial raw text nodes (or re-capture if child nodes were replaced)
|
|
52
|
+
const needsRescan = !this._originalTextNodes || this._originalTextNodes.length === 0 || this._originalTextNodes.some(item => !this.dom.contains(item.node));
|
|
53
|
+
if (needsRescan) {
|
|
54
|
+
this._originalTextNodes = [];
|
|
55
|
+
if (typeof document !== 'undefined' && document.createTreeWalker) {
|
|
56
|
+
const walker = document.createTreeWalker(this.dom, NodeFilter.SHOW_TEXT, {
|
|
57
|
+
acceptNode: function (node) {
|
|
58
|
+
if (node.parentElement && node.parentElement.classList && node.parentElement.classList.contains('sr-only')) {
|
|
59
|
+
return NodeFilter.FILTER_REJECT;
|
|
60
|
+
}
|
|
61
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
while (walker.nextNode()) {
|
|
65
|
+
this._originalTextNodes.push({
|
|
66
|
+
node: walker.currentNode,
|
|
67
|
+
raw: walker.currentNode.nodeValue
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const rawShift = this.dom.getAttribute(DOM_SELECTOR);
|
|
74
|
+
const parsed = parseInt(rawShift, 10);
|
|
75
|
+
const shift = isNaN(parsed) ? 13 : parsed;
|
|
76
|
+
|
|
77
|
+
const rawCodec = (this.dom.getAttribute('data-ln-obfuscator-codec') || '').toLowerCase().trim();
|
|
78
|
+
const rawKey = this.dom.getAttribute('data-ln-obfuscator-key');
|
|
79
|
+
|
|
80
|
+
let codec = 'rot';
|
|
81
|
+
if (rawCodec === 'xor' || rawCodec === 'base64') {
|
|
82
|
+
codec = rawCodec;
|
|
83
|
+
} else if (rawKey) {
|
|
84
|
+
codec = 'xor';
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const key = rawKey || 'ln-ashlar';
|
|
88
|
+
const options = { codec, shift, key };
|
|
89
|
+
|
|
90
|
+
// Reset premature ln-external-links decoration if present
|
|
91
|
+
if (isLink && this.dom.getAttribute('data-ln-external-link') === 'processed') {
|
|
92
|
+
const hints = this.dom.querySelectorAll('.sr-only');
|
|
93
|
+
for (let i = 0; i < hints.length; i++) {
|
|
94
|
+
hints[i].remove();
|
|
95
|
+
}
|
|
96
|
+
this.dom.removeAttribute('data-ln-external-link');
|
|
97
|
+
this.dom.removeAttribute('target');
|
|
98
|
+
const relParts = (this.dom.rel || '').split(/\s+/).filter(function (r) {
|
|
99
|
+
return r && r !== 'noopener' && r !== 'noreferrer';
|
|
100
|
+
});
|
|
101
|
+
if (relParts.length > 0) {
|
|
102
|
+
this.dom.rel = relParts.join(' ');
|
|
103
|
+
} else {
|
|
104
|
+
this.dom.removeAttribute('rel');
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Apply deobfuscation to text nodes using the stored original raw text
|
|
109
|
+
if (this._originalTextNodes) {
|
|
110
|
+
for (let i = 0; i < this._originalTextNodes.length; i++) {
|
|
111
|
+
const item = this._originalTextNodes[i];
|
|
112
|
+
if (item.node && item.raw && item.raw.length > 0) {
|
|
113
|
+
item.node.nodeValue = deobfuscate(item.raw, options);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Apply deobfuscation to href attribute using stored original raw href
|
|
119
|
+
if (isLink && this._originalHref) {
|
|
120
|
+
const deobfuscatedHref = deobfuscate(this._originalHref, options);
|
|
121
|
+
this.dom.setAttribute('href', deobfuscatedHref);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
dispatch(this.dom, 'ln-obfuscator:deobfuscated', {
|
|
125
|
+
target: this.dom,
|
|
126
|
+
codec: codec,
|
|
127
|
+
shift: shift,
|
|
128
|
+
key: codec === 'xor' ? key : null
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
_component.prototype.destroy = function () {
|
|
133
|
+
if (!this.dom[DOM_ATTRIBUTE]) return;
|
|
134
|
+
if (this._originalTextNodes) {
|
|
135
|
+
for (let i = 0; i < this._originalTextNodes.length; i++) {
|
|
136
|
+
const item = this._originalTextNodes[i];
|
|
137
|
+
if (item.node && item.raw) {
|
|
138
|
+
item.node.nodeValue = item.raw;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (this._originalHref !== null) {
|
|
143
|
+
this.dom.setAttribute('href', this._originalHref);
|
|
144
|
+
}
|
|
145
|
+
delete this.dom[DOM_ATTRIBUTE];
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// ─── Registration & Global Helpers ──────────────────────
|
|
149
|
+
const constructor = registerComponent(DOM_SELECTOR, DOM_ATTRIBUTE, _component, 'ln-obfuscator', {
|
|
150
|
+
attributes: ATTRIBUTES
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
constructor.obfuscate = obfuscate;
|
|
154
|
+
constructor.deobfuscate = deobfuscate;
|
|
155
|
+
constructor.utf8ToBase64 = utf8ToBase64;
|
|
156
|
+
constructor.base64ToUtf8 = base64ToUtf8;
|
|
157
|
+
constructor.xorObfuscate = xorObfuscate;
|
|
158
|
+
constructor.xorDeobfuscate = xorDeobfuscate;
|
|
159
|
+
})();
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* components/ln-obfuscator/src/obfuscator-model.js
|
|
3
|
+
*
|
|
4
|
+
* Pure cipher and encoding algorithms for ln-obfuscator.
|
|
5
|
+
* Supports:
|
|
6
|
+
* - 'rot' (default): Caesar / ROT-N on [a-zA-Z] (mod 26) and [0-9] (mod 10).
|
|
7
|
+
* - 'base64': UTF-8 safe Base64 encoding for arbitrary unicode / scripts (Cyrillic, CJK, etc.).
|
|
8
|
+
* - 'xor': Symmetric multi-byte XOR cipher with Base64 ASCII transport for arbitrary unicode.
|
|
9
|
+
*
|
|
10
|
+
* Zero DOM dependencies.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Shifts an ASCII alphabetic character (mod 26) or digit (mod 10) by the given offset (preserving case).
|
|
15
|
+
* Non-alphanumeric characters (symbols, spaces, unicode) are returned untouched.
|
|
16
|
+
*
|
|
17
|
+
* @param {string} char - Single character
|
|
18
|
+
* @param {number} shift - Integer shift offset
|
|
19
|
+
* @returns {string} Shifted character
|
|
20
|
+
*/
|
|
21
|
+
export function rotChar(char, shift) {
|
|
22
|
+
if (char.length !== 1) return char;
|
|
23
|
+
const code = char.charCodeAt(0);
|
|
24
|
+
|
|
25
|
+
// Uppercase A-Z (65-90)
|
|
26
|
+
if (code >= 65 && code <= 90) {
|
|
27
|
+
const offset = ((code - 65 + shift) % 26 + 26) % 26;
|
|
28
|
+
return String.fromCharCode(65 + offset);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Lowercase a-z (97-122)
|
|
32
|
+
if (code >= 97 && code <= 122) {
|
|
33
|
+
const offset = ((code - 97 + shift) % 26 + 26) % 26;
|
|
34
|
+
return String.fromCharCode(97 + offset);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Digits 0-9 (48-57)
|
|
38
|
+
if (code >= 48 && code <= 57) {
|
|
39
|
+
const offset = ((code - 48 + shift) % 10 + 10) % 10;
|
|
40
|
+
return String.fromCharCode(48 + offset);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return char;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Encodes any UTF-8 string into Base64 (browser & Node compatible, Unicode-safe).
|
|
48
|
+
*
|
|
49
|
+
* @param {string} str - Input text
|
|
50
|
+
* @returns {string} Base64 encoded string
|
|
51
|
+
*/
|
|
52
|
+
export function utf8ToBase64(str) {
|
|
53
|
+
if (str == null || str === '') return '';
|
|
54
|
+
const input = String(str);
|
|
55
|
+
if (typeof TextEncoder !== 'undefined' && typeof btoa !== 'undefined') {
|
|
56
|
+
const bytes = new TextEncoder().encode(input);
|
|
57
|
+
let binary = '';
|
|
58
|
+
const len = bytes.length;
|
|
59
|
+
for (let i = 0; i < len; i++) {
|
|
60
|
+
binary += String.fromCharCode(bytes[i]);
|
|
61
|
+
}
|
|
62
|
+
return btoa(binary);
|
|
63
|
+
}
|
|
64
|
+
if (typeof Buffer !== 'undefined') {
|
|
65
|
+
return Buffer.from(input, 'utf-8').toString('base64');
|
|
66
|
+
}
|
|
67
|
+
return '';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Decodes a Base64 string back into a UTF-8 string (browser & Node compatible, Unicode-safe).
|
|
72
|
+
*
|
|
73
|
+
* @param {string} b64 - Base64 string
|
|
74
|
+
* @returns {string} Decoded UTF-8 string
|
|
75
|
+
*/
|
|
76
|
+
export function base64ToUtf8(b64) {
|
|
77
|
+
if (b64 == null || b64 === '') return '';
|
|
78
|
+
try {
|
|
79
|
+
const trimmed = String(b64).trim();
|
|
80
|
+
if (typeof atob !== 'undefined' && typeof TextDecoder !== 'undefined') {
|
|
81
|
+
const binary = atob(trimmed);
|
|
82
|
+
const bytes = new Uint8Array(binary.length);
|
|
83
|
+
for (let i = 0; i < binary.length; i++) {
|
|
84
|
+
bytes[i] = binary.charCodeAt(i);
|
|
85
|
+
}
|
|
86
|
+
return new TextDecoder().decode(bytes);
|
|
87
|
+
}
|
|
88
|
+
if (typeof Buffer !== 'undefined') {
|
|
89
|
+
return Buffer.from(trimmed, 'base64').toString('utf-8');
|
|
90
|
+
}
|
|
91
|
+
} catch {
|
|
92
|
+
return b64;
|
|
93
|
+
}
|
|
94
|
+
return b64;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Performs byte-level XOR with a repeating key.
|
|
99
|
+
*
|
|
100
|
+
* @param {Uint8Array} bytes - Input bytes
|
|
101
|
+
* @param {string} keyStr - Key string
|
|
102
|
+
* @returns {Uint8Array} XOR transformed bytes
|
|
103
|
+
*/
|
|
104
|
+
export function xorBytes(bytes, keyStr) {
|
|
105
|
+
const key = String(keyStr || 'ln-ashlar');
|
|
106
|
+
let keyBytes;
|
|
107
|
+
if (typeof TextEncoder !== 'undefined') {
|
|
108
|
+
keyBytes = new TextEncoder().encode(key);
|
|
109
|
+
} else if (typeof Buffer !== 'undefined') {
|
|
110
|
+
keyBytes = Buffer.from(key, 'utf-8');
|
|
111
|
+
} else {
|
|
112
|
+
keyBytes = [108, 110];
|
|
113
|
+
}
|
|
114
|
+
const keyLen = keyBytes.length || 1;
|
|
115
|
+
const out = new Uint8Array(bytes.length);
|
|
116
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
117
|
+
out[i] = bytes[i] ^ keyBytes[i % keyLen];
|
|
118
|
+
}
|
|
119
|
+
return out;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Obfuscates UTF-8 text with an XOR cipher and returns Base64 ASCII text.
|
|
124
|
+
*
|
|
125
|
+
* @param {string} text - Input text (any script / unicode)
|
|
126
|
+
* @param {string} [key='ln-ashlar'] - Secret key
|
|
127
|
+
* @returns {string} Base64 encoded XOR payload
|
|
128
|
+
*/
|
|
129
|
+
export function xorObfuscate(text, key = 'ln-ashlar') {
|
|
130
|
+
if (text == null || text === '') return '';
|
|
131
|
+
const input = String(text);
|
|
132
|
+
let bytes;
|
|
133
|
+
if (typeof TextEncoder !== 'undefined') {
|
|
134
|
+
bytes = new TextEncoder().encode(input);
|
|
135
|
+
} else if (typeof Buffer !== 'undefined') {
|
|
136
|
+
bytes = Buffer.from(input, 'utf-8');
|
|
137
|
+
} else {
|
|
138
|
+
return '';
|
|
139
|
+
}
|
|
140
|
+
const xored = xorBytes(bytes, key);
|
|
141
|
+
let binary = '';
|
|
142
|
+
for (let i = 0; i < xored.length; i++) {
|
|
143
|
+
binary += String.fromCharCode(xored[i]);
|
|
144
|
+
}
|
|
145
|
+
if (typeof btoa !== 'undefined') {
|
|
146
|
+
return btoa(binary);
|
|
147
|
+
}
|
|
148
|
+
if (typeof Buffer !== 'undefined') {
|
|
149
|
+
return Buffer.from(xored).toString('base64');
|
|
150
|
+
}
|
|
151
|
+
return '';
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Deobfuscates Base64 ASCII XOR payload back into UTF-8 text.
|
|
156
|
+
*
|
|
157
|
+
* @param {string} b64 - Base64 encoded XOR payload
|
|
158
|
+
* @param {string} [key='ln-ashlar'] - Secret key used during obfuscation
|
|
159
|
+
* @returns {string} Plain UTF-8 text
|
|
160
|
+
*/
|
|
161
|
+
export function xorDeobfuscate(b64, key = 'ln-ashlar') {
|
|
162
|
+
if (b64 == null || b64 === '') return '';
|
|
163
|
+
try {
|
|
164
|
+
const trimmed = String(b64).trim();
|
|
165
|
+
let binary = '';
|
|
166
|
+
if (typeof atob !== 'undefined') {
|
|
167
|
+
binary = atob(trimmed);
|
|
168
|
+
} else if (typeof Buffer !== 'undefined') {
|
|
169
|
+
binary = Buffer.from(trimmed, 'base64').toString('binary');
|
|
170
|
+
} else {
|
|
171
|
+
return b64;
|
|
172
|
+
}
|
|
173
|
+
const bytes = new Uint8Array(binary.length);
|
|
174
|
+
for (let i = 0; i < binary.length; i++) {
|
|
175
|
+
bytes[i] = binary.charCodeAt(i);
|
|
176
|
+
}
|
|
177
|
+
const xored = xorBytes(bytes, key);
|
|
178
|
+
if (typeof TextDecoder !== 'undefined') {
|
|
179
|
+
return new TextDecoder().decode(xored);
|
|
180
|
+
}
|
|
181
|
+
if (typeof Buffer !== 'undefined') {
|
|
182
|
+
return Buffer.from(xored).toString('utf-8');
|
|
183
|
+
}
|
|
184
|
+
} catch {
|
|
185
|
+
return b64;
|
|
186
|
+
}
|
|
187
|
+
return b64;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Parses options argument for obfuscate / deobfuscate.
|
|
192
|
+
* @private
|
|
193
|
+
*/
|
|
194
|
+
function _parseOptions(options) {
|
|
195
|
+
if (typeof options === 'number' || (typeof options === 'string' && /^-?\d+$/.test(String(options).trim()))) {
|
|
196
|
+
return { codec: 'rot', shift: Number(options) || 13, key: 'ln-ashlar' };
|
|
197
|
+
}
|
|
198
|
+
if (options && typeof options === 'object') {
|
|
199
|
+
const rawCodec = (options.codec || (options.key ? 'xor' : 'rot')).toLowerCase().trim();
|
|
200
|
+
const codec = (rawCodec === 'xor' || rawCodec === 'base64') ? rawCodec : 'rot';
|
|
201
|
+
const shift = Number(options.shift) || 13;
|
|
202
|
+
const key = options.key || 'ln-ashlar';
|
|
203
|
+
return { codec, shift, key };
|
|
204
|
+
}
|
|
205
|
+
return { codec: 'rot', shift: 13, key: 'ln-ashlar' };
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Obfuscates a string with the configured codec ('rot', 'base64', or 'xor').
|
|
210
|
+
*
|
|
211
|
+
* @param {string} text - Input text
|
|
212
|
+
* @param {number|object} [options=13] - Shift offset (number) or options object `{ codec, shift, key }`
|
|
213
|
+
* @returns {string} Obfuscated string
|
|
214
|
+
*/
|
|
215
|
+
export function obfuscate(text, options = 13) {
|
|
216
|
+
if (text == null) return '';
|
|
217
|
+
if (typeof text !== 'string') text = String(text);
|
|
218
|
+
if (text.length === 0) return '';
|
|
219
|
+
|
|
220
|
+
const opts = _parseOptions(options);
|
|
221
|
+
if (opts.codec === 'base64') {
|
|
222
|
+
return utf8ToBase64(text);
|
|
223
|
+
}
|
|
224
|
+
if (opts.codec === 'xor') {
|
|
225
|
+
return xorObfuscate(text, opts.key);
|
|
226
|
+
}
|
|
227
|
+
return text.replace(/[a-zA-Z0-9]/g, (c) => rotChar(c, opts.shift));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Deobfuscates a string by reversing the configured codec ('rot', 'base64', or 'xor').
|
|
232
|
+
*
|
|
233
|
+
* @param {string} text - Obfuscated text
|
|
234
|
+
* @param {number|object} [options=13] - Original shift offset (number) or options object `{ codec, shift, key }`
|
|
235
|
+
* @returns {string} Plain text
|
|
236
|
+
*/
|
|
237
|
+
export function deobfuscate(text, options = 13) {
|
|
238
|
+
if (text == null) return '';
|
|
239
|
+
if (typeof text !== 'string') text = String(text);
|
|
240
|
+
if (text.length === 0) return '';
|
|
241
|
+
|
|
242
|
+
const opts = _parseOptions(options);
|
|
243
|
+
if (opts.codec === 'base64') {
|
|
244
|
+
return base64ToUtf8(text);
|
|
245
|
+
}
|
|
246
|
+
if (opts.codec === 'xor') {
|
|
247
|
+
return xorDeobfuscate(text, opts.key);
|
|
248
|
+
}
|
|
249
|
+
return text.replace(/[a-zA-Z0-9]/g, (c) => rotChar(c, -opts.shift));
|
|
250
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# ln-options
|
|
2
2
|
|
|
3
|
+
> Applied to a `<select data-ln-options="storeName" data-ln-options-value="id" data-ln-options-label="name">` element inside a coordinator subtree. It emits `ln-options:request-data` on initialization and listens for `ln-options:set-data` to populate `<option>` elements while preserving the placeholder and restoring previous selection. It never accesses IndexedDB or network endpoints directly, leaving data resolution entirely to `ln-data-coordinator`.
|
|
4
|
+
|
|
3
5
|
Populates a `<select>` element with records from an `ln-data-store` via the `ln-data-coordinator` binder. Opt-in: add `data-ln-options="<storeName>"` to any `<select>` inside (or reachable by) a coordinator subtree.
|
|
4
6
|
|
|
5
7
|
No `<template>` needed — ln-options writes `<option>` elements directly (value + label only).
|
|
@@ -55,7 +57,7 @@ The placeholder `<option value="">` is preserved across refreshes. The previous
|
|
|
55
57
|
|
|
56
58
|
## 🔧 Internals
|
|
57
59
|
|
|
58
|
-
Source: `
|
|
60
|
+
Source: `components/ln-options/src/ln-options.js`. Pure event client — never imports or reads `ln-data-store` directly.
|
|
59
61
|
|
|
60
62
|
### Coordinator wiring
|
|
61
63
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@use '../../theme/config/mixins' as *;
|
|
2
|
+
|
|
3
|
+
[data-ln-debug] {
|
|
4
|
+
// 1. Host Element Check: data-ln-options belongs only on <select>
|
|
5
|
+
[data-ln-options]:not(select) {
|
|
6
|
+
@include dev-inline-error("data-ln-options belongs only on <select> elements");
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// 2. Store Name Check: source store name cannot be empty
|
|
10
|
+
[data-ln-options=""] {
|
|
11
|
+
@include dev-inline-error("data-ln-options store name cannot be empty");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){"use strict";function D(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function m(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!m(r))return}e.apply(console,t)}}function $(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function C(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){C(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const F={};function V(e,t){F[e]=t}function H(e){return F[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=V,window.lnCore.getDataMapper=H);function U(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){$(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const T={};function Q(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];T[n]=t}function J(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return T[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Q,window.lnCore.getLocaleFallback=J,window.lnCore.ensureLocaleObserver=U);const A={};function K(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=A[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function I(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const a=n[l],s=a.getAttribute("data-ln-field");t[s]!=null&&(a.textContent=t[s])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const a=r[l],s=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<s.length;c++){const d=s[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&a.setAttribute(u,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const a=o[l],s=a.getAttribute("data-ln-show");s in t&&a.classList.toggle("hidden",!t[s])}const i=e.querySelectorAll("[data-ln-class]");for(let l=0;l<i.length;l++){const a=i[l],s=a.getAttribute("data-ln-class").split(",");for(let c=0;c<s.length;c++){const d=s[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&a.classList.toggle(u,!!t[f])}}return e}function P(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)I(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function q(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const r=function(i,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let i=0;i<o.length;i++){const l=o[i],a=l.attributes;for(let s=0;s<a.length;s++){const c=a[s];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function G(e,t,n,r,o,i){const l={};for(let s=0;s<e.children.length;s++){const c=e.children[s],d=c.getAttribute("data-ln-render-key");d&&(l[d]=c)}const a=document.createDocumentFragment();for(let s=0;s<t.length;s++){const c=t[s],d=String(r(c));let u=l[d];if(u)o(u,c,s);else{const f=K(n,i);if(!f||(q(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),o(u,c,s)}a.appendChild(u)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=q,window.lnCore.fill=I,window.lnCore.lnFill=P,window.lnCore.renderList=G);function b(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function X(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function z(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function Y(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const _=new Map;function Z(e,t){const n=(e?e.join("|"):"")+"::"+t;if(_.has(n))return _.get(n);const r=new Set(e||[]),o=function(i,l){const a=i.getAttribute(l);return a!==null&&r.has(a)?a:t};return _.set(n,o),o}function ee(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function te(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function N(e,t,n,r,o){if(!e||t===null)return!0;const i=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=s=>{o?console.warn(s,o):console.warn(s)};if(l==="boolean"){const s=t.trim().toLowerCase();return s!==""&&s!=="true"&&s!=="false"&&s!=="1"&&s!=="0"?(a(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const s=e.values||[];return s.includes(t)?!0:(a(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${s.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return a(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const s=parseInt(t,10);return e.min!==void 0&&s<e.min?(a(`[${i}] Value ${s} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&s>e.max?(a(`[${i}] Value ${s} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(a(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(s){return a(`[${i}] Invalid JSON for attribute "${n}": ${s.message}. Fallback: ${e.fallback}.`),!1}return!0}function ne(e,t,n){for(const r in n){const[o,i,l]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,i,l)},enumerable:!0,configurable:!0})}return e}function re(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=Z(r.values,r.fallback);break;case"integer":o=X;break;case"float":o=ee;break;case"boolean":o=z;break;case"list":o=Y;break;case"json":o=te;break;case"string":default:o=b;break}o||(o=b),t[r.prop]=[o,n,r.fallback]}return t}function oe(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function ie(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function v(e,t,n,r){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(i));e.matches&&e.matches(i)&&l.push(e);for(const a of l)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(s){console.error("["+n+"] init failed",a,s)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function le(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function se(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function R(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ae(e){const t=R(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(i=>i.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=ie(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function M(e,t,n,r){for(let o=0;o<e.length;o++){const i=e[o];if(!t[i.attribute])continue;const l=i.effects&&i.effects[n];l?l(t,n,r):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,r)}}function ce(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=R(),o=r.byAttr.get(n);if(D()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&m(t)){const i=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let a=0;a<i.length;a++)N(i[a].spec,l,n,i[a].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const i=r.byReactive.get(n);i&&M(i,t,n,e.oldValue),r.reactiveWildcard.length&&M(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let i=0;i<o.length;i++){const l=o[i];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(v(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function ue(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,C(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ce(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function B(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function de(e){const t=B();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,i=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;i&&r.onSubtreeChange(i,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const i=t[o];v(r,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const i=t[o],l=i.query,a=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&a.push(r);for(let s=0;s<a.length;s++){const c=a[s];if(!document.contains(c)){const d=c[i.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(u){console.error("["+i.attribute+"] destroy failed",c,u)}delete c[i.attribute]}}}}}}function fe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,C(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{de(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function we(e,t,n,r,o={}){const i=o.extraAttributes||[],l=o.onAttributeChange||null,a=o.onSubtreeChange||null,s=o.onInit||null,c=o.onAttrChange||null,d=o.effects||null,u=o.attributes||null,f=u?oe(u):d,h=u?new Set(Object.keys(u)):null,p=o.persist||null;function y(O){const w=O||document.body;if(v(w,e,t,n),u&&D())for(const g in u){const ve=u[g],x=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&x.push(w);for(let E=0;E<x.length;E++){const L=x[E];m(L)&&N(ve,L.getAttribute(g),g,r,L)}}s&&s(w)}const k=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let w;for(;(w=O.exec(e))!==null;)k.push(w[1])}else k.push(e);ae({selector:e,attribute:t,componentTag:r,attributes:u,ComponentFn:n,onInit:s,observed:k.concat(i),onAttributeChange:l,onAttrChange:c,effects:f,declared:h,persist:p}),ue();const _e=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";B().push({selector:e,attribute:t,ComponentFn:n,onInit:s,onSubtreeChange:a,query:_e}),fe(),window[t]=y;function W(){le()>0?se(function(){y(document.body)}):y(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",W):W(),y}function j(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,n={},r=j(t);if(!r)return n;const o=r.split("&");for(let i=0;i<o.length;i++){const l=o[i];if(!l)continue;const a=l.indexOf(":"),s=a>-1?l.slice(0,a):l,c=a>-1?l.slice(a+1):"";if(s)try{n[s]=decodeURIComponent(c)}catch{n[s]=c}}return n}function be(e){if(!e)return null;const t=S();return e in t?t[e]:null}function he(e,t){if(!e)return;const n=S();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(i){const l=n[i];return l===""?i:i+":"+encodeURIComponent(l)}).join("&");j(location.hash)!==o&&(location.hash=o)}function pe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ge(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Ce(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ye(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function me(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ae(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=be,window.lnCore.hashSet=he,window.lnCore.hashLinkClick=pe,window.lnCore.resolveHashNamespace=ge,window.lnCore.hashSortEncode=Ce,window.lnCore.hashSortDecode=ye,window.lnCore.hashFilterEncode=me,window.lnCore.hashFilterDecode=Ae),(function(){const e="data-ln-options",t="lnOptions";if(window[t]!==void 0)return;const n={"data-ln-options":{prop:"_storeName",type:"string",read:b,fallback:"",description:"Store or coordinator addressing to populate options from"},"data-ln-options-value":{prop:"_valueField",type:"string",read:b,fallback:"id",description:"Field name used for option value attribute"},"data-ln-options-label":{prop:"_labelField",type:"string",read:b,fallback:"name",description:"Field name used for option visible label text"}},r=re(n);function o(i){this.dom=i,ne(this,i,r);const l=this;return this._onSetData=function(a){l._rebuild(a.detail.data||[])},i.addEventListener("ln-options:set-data",this._onSetData),$(i,"ln-options:request-data",{options:this._storeName}),this}o.prototype._rebuild=function(i){const l=this.dom,a=this._valueField,s=this._labelField,c=l.value,d=l.querySelectorAll("option");for(let f=d.length-1;f>=0;f--)d[f].value!==""&&l.removeChild(d[f]);for(let f=0;f<i.length;f++){const h=i[f],p=document.createElement("option");p.value=String(h[a]),p.textContent=h[s]!=null?h[s]:"",l.appendChild(p)}const u=l.options;for(let f=0;f<u.length;f++)if(u[f].value===c){l.value=c;break}},o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-options:set-data",this._onSetData),delete this.dom[t])},we(e,t,o,"ln-options",{attributes:n})})()})();
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "This file is partly generated. The $comment, component, generator, and each attribute's direction, sources, type, values, fallback, and description keys are owned by the generator and synchronized from JS source code. All other keys are preserved and safe to hand-author. Regenerate with `npm run sync:ln-schemas`.",
|
|
3
|
+
"component": "ln-options",
|
|
4
|
+
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"data-ln-debug": {
|
|
7
|
+
"direction": null,
|
|
8
|
+
"sources": [
|
|
9
|
+
"ln-options-dev.scss"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"data-ln-options": {
|
|
13
|
+
"direction": null,
|
|
14
|
+
"sources": [
|
|
15
|
+
"ln-options-dev.scss",
|
|
16
|
+
"src/ln-options.js"
|
|
17
|
+
],
|
|
18
|
+
"type": "string",
|
|
19
|
+
"fallback": "",
|
|
20
|
+
"description": "Store or coordinator addressing to populate options from"
|
|
21
|
+
},
|
|
22
|
+
"data-ln-options-label": {
|
|
23
|
+
"direction": null,
|
|
24
|
+
"sources": [
|
|
25
|
+
"src/ln-options.js"
|
|
26
|
+
],
|
|
27
|
+
"type": "string",
|
|
28
|
+
"fallback": "name",
|
|
29
|
+
"description": "Field name used for option visible label text"
|
|
30
|
+
},
|
|
31
|
+
"data-ln-options-value": {
|
|
32
|
+
"direction": null,
|
|
33
|
+
"sources": [
|
|
34
|
+
"src/ln-options.js"
|
|
35
|
+
],
|
|
36
|
+
"type": "string",
|
|
37
|
+
"fallback": "id",
|
|
38
|
+
"description": "Field name used for option value attribute"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { registerComponent, dispatch } from '../../ln-core';
|
|
1
|
+
import { registerComponent, dispatch, defineAttrs, attrSpec, attrStr } from '../../ln-core';
|
|
2
2
|
|
|
3
3
|
(function () {
|
|
4
4
|
const DOM_SELECTOR = 'data-ln-options';
|
|
@@ -6,13 +6,19 @@ import { registerComponent, dispatch } from '../../ln-core';
|
|
|
6
6
|
|
|
7
7
|
if (window[DOM_ATTRIBUTE] !== undefined) return;
|
|
8
8
|
|
|
9
|
+
// ─── Attribute Contract (SSOT) ──────────────────────────
|
|
10
|
+
const ATTRIBUTES = {
|
|
11
|
+
'data-ln-options': { prop: '_storeName', type: 'string', read: attrStr, fallback: '', description: 'Store or coordinator addressing to populate options from' },
|
|
12
|
+
'data-ln-options-value': { prop: '_valueField', type: 'string', read: attrStr, fallback: 'id', description: 'Field name used for option value attribute' },
|
|
13
|
+
'data-ln-options-label': { prop: '_labelField', type: 'string', read: attrStr, fallback: 'name', description: 'Field name used for option visible label text' }
|
|
14
|
+
};
|
|
15
|
+
const ATTR_SPEC = attrSpec(ATTRIBUTES);
|
|
16
|
+
|
|
9
17
|
// ─── Component ─────────────────────────────────────────────
|
|
10
18
|
|
|
11
19
|
function _component(dom) {
|
|
12
20
|
this.dom = dom;
|
|
13
|
-
this
|
|
14
|
-
this._valueField = dom.getAttribute('data-ln-options-value') || 'id';
|
|
15
|
-
this._labelField = dom.getAttribute('data-ln-options-label') || 'name';
|
|
21
|
+
defineAttrs(this, dom, ATTR_SPEC);
|
|
16
22
|
|
|
17
23
|
const self = this;
|
|
18
24
|
|
|
@@ -70,5 +76,7 @@ import { registerComponent, dispatch } from '../../ln-core';
|
|
|
70
76
|
|
|
71
77
|
// ─── Init ──────────────────────────────────────────────────
|
|
72
78
|
|
|
73
|
-
registerComponent(DOM_SELECTOR, DOM_ATTRIBUTE, _component, 'ln-options'
|
|
79
|
+
registerComponent(DOM_SELECTOR, DOM_ATTRIBUTE, _component, 'ln-options', {
|
|
80
|
+
attributes: ATTRIBUTES
|
|
81
|
+
});
|
|
74
82
|
})();
|