@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,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a URL from segments, stripping duplicate slashes.
|
|
3
|
+
*/
|
|
4
|
+
export function buildUrl(...segments) {
|
|
5
|
+
return segments
|
|
6
|
+
.filter(x => x !== undefined && x !== null && x !== '')
|
|
7
|
+
.map((part, index) => {
|
|
8
|
+
if (index === 0) return part.replace(/\/+$/, '');
|
|
9
|
+
return part.replace(/^\/+/, '').replace(/\/+$/, '');
|
|
10
|
+
})
|
|
11
|
+
.filter(Boolean)
|
|
12
|
+
.join('/');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Compile standard JSON request headers.
|
|
17
|
+
*/
|
|
18
|
+
export function getHeaders(customHeaders, auth) {
|
|
19
|
+
return Object.assign({
|
|
20
|
+
'Content-Type': 'application/json',
|
|
21
|
+
'Accept': 'application/json'
|
|
22
|
+
}, customHeaders, auth ? { 'Authorization': auth } : null);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Safely parse headers from JSON string.
|
|
27
|
+
*/
|
|
28
|
+
export function parseHeaders(str, componentName = 'ln-core') {
|
|
29
|
+
try { return str ? JSON.parse(str) : {}; }
|
|
30
|
+
catch (e) { return console.error(`[${componentName}] Invalid headers JSON:`, e), {}; }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// ─── Domain Data Mapper Registry ───────────────────────────
|
|
34
|
+
const _dataMappers = {};
|
|
35
|
+
|
|
36
|
+
export function registerDataMapper(name, mapper) {
|
|
37
|
+
_dataMappers[name] = mapper;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function getDataMapper(name) {
|
|
41
|
+
return _dataMappers[name] || { ingress: r => r, egress: r => r };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (typeof window !== 'undefined') {
|
|
45
|
+
window.lnCore = window.lnCore || {};
|
|
46
|
+
window.lnCore.registerDataMapper = registerDataMapper;
|
|
47
|
+
window.lnCore.getDataMapper = getDataMapper;
|
|
48
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { cloneTemplate, cloneTemplateScoped, dispatch, dispatchCancelable, requestData, fill, lnFill, fillTemplate, renderList, buildDict, guardBody, findElements, isVisible, shouldIgnoreClick, isTargetDisabled, isUsableTarget, isEditableTarget, serializeForm, populateForm, resolveFormMethod, getLocale, readValue, detectValueType, compareValues, registerComponent, shouldInterceptLink, buildUrl, getHeaders, parseHeaders, registerDataMapper, getDataMapper, interceptValueProperty, registerLocaleFallback, getLocaleFallback, holdInit, releaseInit, pendingCount, queueBoot, ensureLocaleObserver, observeAttributes, setDebugSink, setPersistSink, isDevMode, hasActiveDebug } from './helpers.js';
|
|
2
|
+
export { reactiveState, deepReactive, createBatcher } from './reactive.js';
|
|
3
|
+
export { createWindowCache } from './window-cache.js';
|
|
4
|
+
export { hashParse, hashGet, hashSet, hashLinkClick, resolveHashNamespace, hashSortEncode, hashSortDecode, hashFilterEncode, hashFilterDecode } from './hash.js';
|
|
5
|
+
export { computePlacement, measureHidden } from './positioning.js';
|
|
6
|
+
export { setCryptoKey, getCryptoKey, clearCryptoKey, hasCryptoKey, deriveCryptoKey, encryptData, decryptData, uint8ToBase64, base64ToUint8 } from './crypto.js';
|
|
7
|
+
export { calculateProgress } from './progress.js';
|
|
8
|
+
export { parseDateInput, formatDateToISO } from './date.js';
|
|
9
|
+
export { getSeparators, cleanNumericString, parseNumber, formatNumber } from './number.js';
|
|
10
|
+
export { normalizeSearchTerm, tokenizeSearchQuery, parseSearchFields, matchesSearchTokens, collapseSearchParts, matchesFilterValues } from './matching.js';
|
|
11
|
+
export { attrStr, attrInt, attrBool, attrList, attrEnum, attrFloat, attrJson, validateAttrValue, defineAttrs, attrSpec, attrEffects } from './attrs.js';
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { attrEffects, reactiveNames, validateAttrValue } from './attrs.js';
|
|
2
|
+
import { hasActiveDebug, isDevMode } from './events.js';
|
|
3
|
+
import { guardBody } from './dom.js';
|
|
4
|
+
|
|
5
|
+
// ─── Find Elements ─────────────────────────────────────────
|
|
6
|
+
|
|
7
|
+
export function findElements(root, selector, attribute, ComponentClass) {
|
|
8
|
+
if (root.nodeType !== 1) return;
|
|
9
|
+
|
|
10
|
+
// Support both simple attribute names and full CSS selectors
|
|
11
|
+
const isComplex = selector.indexOf('[') !== -1 || selector.indexOf('.') !== -1 || selector.indexOf('#') !== -1;
|
|
12
|
+
const query = isComplex ? selector : '[' + selector + ']';
|
|
13
|
+
|
|
14
|
+
const items = Array.from(root.querySelectorAll(query));
|
|
15
|
+
if (root.matches && root.matches(query)) {
|
|
16
|
+
items.push(root);
|
|
17
|
+
}
|
|
18
|
+
for (const el of items) {
|
|
19
|
+
if (!el[attribute]) {
|
|
20
|
+
if (window.lnCore._persistSink && el.hasAttribute('data-ln-persist')) {
|
|
21
|
+
window.lnCore._persistSink(el, selector);
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
el[attribute] = new ComponentClass(el);
|
|
25
|
+
} catch (err) {
|
|
26
|
+
console.error('[' + attribute + '] init failed', el, err);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// ─── Loader Gate State & Primitives ──────────────────────
|
|
33
|
+
if (typeof window !== 'undefined') {
|
|
34
|
+
window.lnCore = window.lnCore || {};
|
|
35
|
+
window.lnCore._bootHolds = window.lnCore._bootHolds || 0;
|
|
36
|
+
window.lnCore._bootQueue = window.lnCore._bootQueue || [];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function holdInit() {
|
|
40
|
+
if (typeof window !== 'undefined') {
|
|
41
|
+
window.lnCore = window.lnCore || {};
|
|
42
|
+
window.lnCore._bootHolds = (window.lnCore._bootHolds || 0) + 1;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function releaseInit() {
|
|
47
|
+
if (typeof window !== 'undefined') {
|
|
48
|
+
window.lnCore = window.lnCore || {};
|
|
49
|
+
window.lnCore._bootHolds = Math.max(0, (window.lnCore._bootHolds || 0) - 1);
|
|
50
|
+
if (window.lnCore._bootHolds === 0 && window.lnCore._bootQueue) {
|
|
51
|
+
const queue = window.lnCore._bootQueue;
|
|
52
|
+
window.lnCore._bootQueue = [];
|
|
53
|
+
for (let i = 0; i < queue.length; i++) {
|
|
54
|
+
queue[i]();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function pendingCount() {
|
|
61
|
+
return (typeof window !== 'undefined' && window.lnCore) ? (window.lnCore._bootHolds || 0) : 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function queueBoot(fn) {
|
|
65
|
+
if (typeof window !== 'undefined') {
|
|
66
|
+
window.lnCore = window.lnCore || {};
|
|
67
|
+
window.lnCore._bootHolds = window.lnCore._bootHolds || 0;
|
|
68
|
+
window.lnCore._bootQueue = window.lnCore._bootQueue || [];
|
|
69
|
+
|
|
70
|
+
if (window.lnCore._bootHolds > 0) {
|
|
71
|
+
window.lnCore._bootQueue.push(fn);
|
|
72
|
+
} else {
|
|
73
|
+
setTimeout(fn, 0);
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
fn();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// ─── Shared Attribute Observer ─────────────────────────────
|
|
81
|
+
|
|
82
|
+
function _attrRegistry() {
|
|
83
|
+
window.lnCore = window.lnCore || {};
|
|
84
|
+
const registry = window.lnCore._attrRegistry = window.lnCore._attrRegistry
|
|
85
|
+
|| { byAttr: new Map(), reactive: [], persist: [] };
|
|
86
|
+
|
|
87
|
+
registry.byReactive = registry.byReactive || new Map();
|
|
88
|
+
registry.reactiveWildcard = registry.reactiveWildcard || [];
|
|
89
|
+
return registry;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function _registerAttrEntry(entry) {
|
|
93
|
+
const registry = _attrRegistry();
|
|
94
|
+
const observed = entry.observed || [];
|
|
95
|
+
for (let i = 0; i < observed.length; i++) {
|
|
96
|
+
const name = observed[i];
|
|
97
|
+
if (!registry.byAttr.has(name)) registry.byAttr.set(name, []);
|
|
98
|
+
registry.byAttr.get(name).push(entry);
|
|
99
|
+
}
|
|
100
|
+
registry.byDeclaredAttr = registry.byDeclaredAttr || new Map();
|
|
101
|
+
if (entry.attributes) {
|
|
102
|
+
for (const attrName in entry.attributes) {
|
|
103
|
+
if (!registry.byDeclaredAttr.has(attrName)) registry.byDeclaredAttr.set(attrName, []);
|
|
104
|
+
const list = registry.byDeclaredAttr.get(attrName);
|
|
105
|
+
if (!list.some(item => item.componentTag === entry.componentTag)) {
|
|
106
|
+
list.push({
|
|
107
|
+
spec: entry.attributes[attrName],
|
|
108
|
+
componentTag: entry.componentTag
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (entry.onAttrChange || entry.effects) {
|
|
114
|
+
registry.reactive.push(entry);
|
|
115
|
+
|
|
116
|
+
const names = reactiveNames(entry);
|
|
117
|
+
if (names === null) {
|
|
118
|
+
registry.reactiveWildcard.push(entry);
|
|
119
|
+
} else {
|
|
120
|
+
for (const name of names) {
|
|
121
|
+
if (!registry.byReactive.has(name)) registry.byReactive.set(name, []);
|
|
122
|
+
registry.byReactive.get(name).push(entry);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (entry.persist) registry.persist.push(entry);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function _runReactive(list, el, name, oldValue) {
|
|
130
|
+
for (let i = 0; i < list.length; i++) {
|
|
131
|
+
const entry = list[i];
|
|
132
|
+
if (!el[entry.attribute]) continue;
|
|
133
|
+
const effect = entry.effects && entry.effects[name];
|
|
134
|
+
if (effect) effect(el, name, oldValue);
|
|
135
|
+
else if (entry.onAttrChange && (!entry.declared || entry.declared.has(name))) entry.onAttrChange(el, name, oldValue);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function _handleAttrMutation(mut) {
|
|
140
|
+
const el = mut.target;
|
|
141
|
+
const name = mut.attributeName;
|
|
142
|
+
|
|
143
|
+
// echo guard — a same-value setAttribute still produces a record
|
|
144
|
+
if (mut.oldValue === el.getAttribute(name)) return;
|
|
145
|
+
|
|
146
|
+
const registry = _attrRegistry();
|
|
147
|
+
const entries = registry.byAttr.get(name);
|
|
148
|
+
|
|
149
|
+
// Dev-mode runtime attribute validation (validates all declared attributes on host or child)
|
|
150
|
+
if (hasActiveDebug() && registry.byDeclaredAttr && registry.byDeclaredAttr.has(name) && isDevMode(el)) {
|
|
151
|
+
const declared = registry.byDeclaredAttr.get(name);
|
|
152
|
+
const val = el.getAttribute(name);
|
|
153
|
+
for (let i = 0; i < declared.length; i++) {
|
|
154
|
+
validateAttrValue(declared[i].spec, val, name, declared[i].componentTag, el);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// debug sink — library attribute mutations only
|
|
159
|
+
if (window.lnCore._debugSink && (name.indexOf('data-ln-') === 0 || entries)) {
|
|
160
|
+
window.lnCore._debugSink('attr', name, el, { oldValue: mut.oldValue, newValue: el.getAttribute(name) });
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Reactive path
|
|
164
|
+
if (name.indexOf('data-ln-') === 0) {
|
|
165
|
+
const byName = registry.byReactive.get(name);
|
|
166
|
+
if (byName) _runReactive(byName, el, name, mut.oldValue);
|
|
167
|
+
|
|
168
|
+
if (registry.reactiveWildcard.length) _runReactive(registry.reactiveWildcard, el, name, mut.oldValue);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (!entries) return;
|
|
172
|
+
for (let i = 0; i < entries.length; i++) {
|
|
173
|
+
const entry = entries[i];
|
|
174
|
+
// Raw handler — components that own their own lifecycle
|
|
175
|
+
if (entry.handler) {
|
|
176
|
+
entry.handler(el, name, mut.oldValue);
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
// Legacy path — fallback for lang/datetime foreign attributes
|
|
180
|
+
if (entry.onAttributeChange && el[entry.attribute]) {
|
|
181
|
+
entry.onAttributeChange(el, name);
|
|
182
|
+
} else {
|
|
183
|
+
findElements(el, entry.selector, entry.attribute, entry.ComponentFn);
|
|
184
|
+
if (entry.onInit) entry.onInit(el);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function _ensureAttrObserver() {
|
|
190
|
+
window.lnCore = window.lnCore || {};
|
|
191
|
+
if (window.lnCore._attrObserverBound) return;
|
|
192
|
+
window.lnCore._attrObserverBound = true;
|
|
193
|
+
|
|
194
|
+
guardBody(function () {
|
|
195
|
+
const observer = new MutationObserver(function (mutations) {
|
|
196
|
+
for (let i = 0; i < mutations.length; i++) {
|
|
197
|
+
try {
|
|
198
|
+
_handleAttrMutation(mutations[i]);
|
|
199
|
+
} catch (err) {
|
|
200
|
+
console.error('[ln-core] mutation handler failed', mutations[i].target, err);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
observer.observe(document.body, {
|
|
205
|
+
attributes: true,
|
|
206
|
+
subtree: true,
|
|
207
|
+
attributeOldValue: true
|
|
208
|
+
});
|
|
209
|
+
}, 'ln-core');
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// ─── Lifecycle Observer & Registry (Single Shared Observer) ───
|
|
213
|
+
|
|
214
|
+
function _lifecycleRegistry() {
|
|
215
|
+
window.lnCore = window.lnCore || {};
|
|
216
|
+
const registry = window.lnCore._lifecycleRegistry = window.lnCore._lifecycleRegistry || [];
|
|
217
|
+
return registry;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function _handleChildListMutation(mutation) {
|
|
221
|
+
const registry = _lifecycleRegistry();
|
|
222
|
+
if (!registry.length) return;
|
|
223
|
+
|
|
224
|
+
if (mutation.target) {
|
|
225
|
+
for (let r = 0; r < registry.length; r++) {
|
|
226
|
+
const entry = registry[r];
|
|
227
|
+
if (entry.onSubtreeChange) {
|
|
228
|
+
const query = entry.query;
|
|
229
|
+
const host = mutation.target.nodeType === 1
|
|
230
|
+
? (mutation.target.matches(query) ? mutation.target : mutation.target.closest(query))
|
|
231
|
+
: (mutation.target.parentElement ? mutation.target.parentElement.closest(query) : null);
|
|
232
|
+
if (host) entry.onSubtreeChange(host, mutation);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
for (let j = 0; j < mutation.addedNodes.length; j++) {
|
|
238
|
+
const node = mutation.addedNodes[j];
|
|
239
|
+
if (node.nodeType === 1) {
|
|
240
|
+
for (let r = 0; r < registry.length; r++) {
|
|
241
|
+
const entry = registry[r];
|
|
242
|
+
findElements(node, entry.selector, entry.attribute, entry.ComponentFn);
|
|
243
|
+
if (entry.onInit) entry.onInit(node);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
for (let j = 0; j < mutation.removedNodes.length; j++) {
|
|
249
|
+
const node = mutation.removedNodes[j];
|
|
250
|
+
if (node.nodeType === 1) {
|
|
251
|
+
for (let r = 0; r < registry.length; r++) {
|
|
252
|
+
const entry = registry[r];
|
|
253
|
+
const query = entry.query;
|
|
254
|
+
const items = Array.from(node.querySelectorAll(query));
|
|
255
|
+
if (node.matches && node.matches(query)) {
|
|
256
|
+
items.push(node);
|
|
257
|
+
}
|
|
258
|
+
for (let k = 0; k < items.length; k++) {
|
|
259
|
+
const item = items[k];
|
|
260
|
+
if (!document.contains(item)) {
|
|
261
|
+
const inst = item[entry.attribute];
|
|
262
|
+
if (inst && typeof inst.destroy === 'function') {
|
|
263
|
+
try {
|
|
264
|
+
inst.destroy();
|
|
265
|
+
} catch (err) {
|
|
266
|
+
console.error('[' + entry.attribute + '] destroy failed', item, err);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
delete item[entry.attribute];
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function _ensureLifecycleObserver() {
|
|
278
|
+
window.lnCore = window.lnCore || {};
|
|
279
|
+
if (window.lnCore._lifecycleObserverBound) return;
|
|
280
|
+
window.lnCore._lifecycleObserverBound = true;
|
|
281
|
+
|
|
282
|
+
guardBody(function () {
|
|
283
|
+
const observer = new MutationObserver(function (mutations) {
|
|
284
|
+
for (let i = 0; i < mutations.length; i++) {
|
|
285
|
+
const mutation = mutations[i];
|
|
286
|
+
if (mutation.type === 'childList') {
|
|
287
|
+
try {
|
|
288
|
+
_handleChildListMutation(mutation);
|
|
289
|
+
} catch (err) {
|
|
290
|
+
console.error('[ln-core] lifecycle handler failed', mutation.target, err);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
observer.observe(document.body, {
|
|
296
|
+
childList: true,
|
|
297
|
+
subtree: true
|
|
298
|
+
});
|
|
299
|
+
}, 'ln-core');
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* For components that own their own lifecycle and only need the attribute
|
|
304
|
+
* half of the shared invariant.
|
|
305
|
+
* @param {string[]} names - attribute names to watch
|
|
306
|
+
* @param {function(Element, string, string):void} handler - (el, attributeName, oldValue)
|
|
307
|
+
*/
|
|
308
|
+
export function observeAttributes(names, handler) {
|
|
309
|
+
_registerAttrEntry({ observed: names, handler: handler });
|
|
310
|
+
_ensureAttrObserver();
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// ─── Component Registration ───────────────────────────────
|
|
314
|
+
|
|
315
|
+
export function registerComponent(selector, attribute, ComponentFn, componentTag, options = {}) {
|
|
316
|
+
const extraAttributes = options.extraAttributes || [];
|
|
317
|
+
const onAttributeChange = options.onAttributeChange || null;
|
|
318
|
+
const onSubtreeChange = options.onSubtreeChange || null;
|
|
319
|
+
const onInit = options.onInit || null;
|
|
320
|
+
const onAttrChange = options.onAttrChange || null;
|
|
321
|
+
const effects = options.effects || null;
|
|
322
|
+
const attributes = options.attributes || null;
|
|
323
|
+
const resolvedEffects = attributes ? attrEffects(attributes) : effects;
|
|
324
|
+
const declared = attributes ? new Set(Object.keys(attributes)) : null;
|
|
325
|
+
const persist = options.persist || null;
|
|
326
|
+
|
|
327
|
+
function constructor(domRoot) {
|
|
328
|
+
const root = domRoot || document.body;
|
|
329
|
+
findElements(root, selector, attribute, ComponentFn);
|
|
330
|
+
if (attributes && hasActiveDebug()) {
|
|
331
|
+
for (const attrName in attributes) {
|
|
332
|
+
const spec = attributes[attrName];
|
|
333
|
+
const nodes = Array.from(root.querySelectorAll('[' + attrName + ']'));
|
|
334
|
+
if (root.matches && root.matches('[' + attrName + ']')) nodes.push(root);
|
|
335
|
+
for (let n = 0; n < nodes.length; n++) {
|
|
336
|
+
const node = nodes[n];
|
|
337
|
+
if (isDevMode(node)) {
|
|
338
|
+
validateAttrValue(spec, node.getAttribute(attrName), attrName, componentTag, node);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
if (onInit) onInit(root);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
const observedAttributes = [];
|
|
347
|
+
if (selector.indexOf('[') !== -1) {
|
|
348
|
+
const re = /\[([\w-]+)/g;
|
|
349
|
+
let match;
|
|
350
|
+
while ((match = re.exec(selector)) !== null) {
|
|
351
|
+
observedAttributes.push(match[1]);
|
|
352
|
+
}
|
|
353
|
+
} else {
|
|
354
|
+
observedAttributes.push(selector);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
_registerAttrEntry({
|
|
358
|
+
selector: selector,
|
|
359
|
+
attribute: attribute,
|
|
360
|
+
componentTag: componentTag,
|
|
361
|
+
attributes: attributes,
|
|
362
|
+
ComponentFn: ComponentFn,
|
|
363
|
+
onInit: onInit,
|
|
364
|
+
observed: observedAttributes.concat(extraAttributes),
|
|
365
|
+
onAttributeChange: onAttributeChange,
|
|
366
|
+
onAttrChange: onAttrChange,
|
|
367
|
+
effects: resolvedEffects,
|
|
368
|
+
declared: declared,
|
|
369
|
+
persist: persist
|
|
370
|
+
});
|
|
371
|
+
_ensureAttrObserver();
|
|
372
|
+
|
|
373
|
+
const isComplex = selector.indexOf('[') !== -1 || selector.indexOf('.') !== -1 || selector.indexOf('#') !== -1;
|
|
374
|
+
const query = isComplex ? selector : '[' + selector + ']';
|
|
375
|
+
|
|
376
|
+
_lifecycleRegistry().push({
|
|
377
|
+
selector: selector,
|
|
378
|
+
attribute: attribute,
|
|
379
|
+
ComponentFn: ComponentFn,
|
|
380
|
+
onInit: onInit,
|
|
381
|
+
onSubtreeChange: onSubtreeChange,
|
|
382
|
+
query: query
|
|
383
|
+
});
|
|
384
|
+
_ensureLifecycleObserver();
|
|
385
|
+
|
|
386
|
+
window[attribute] = constructor;
|
|
387
|
+
|
|
388
|
+
function boot() {
|
|
389
|
+
if (pendingCount() > 0) {
|
|
390
|
+
queueBoot(function () { constructor(document.body); });
|
|
391
|
+
} else {
|
|
392
|
+
constructor(document.body);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
if (document.readyState === 'loading') {
|
|
397
|
+
document.addEventListener('DOMContentLoaded', boot);
|
|
398
|
+
} else {
|
|
399
|
+
boot();
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
return constructor;
|
|
403
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
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-core",
|
|
4
|
+
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"data-ln-attr": {
|
|
7
|
+
"direction": "author",
|
|
8
|
+
"sources": [
|
|
9
|
+
"template.js"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"data-ln-class": {
|
|
13
|
+
"direction": "author",
|
|
14
|
+
"sources": [
|
|
15
|
+
"template.js"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"data-ln-debug": {
|
|
19
|
+
"direction": "author",
|
|
20
|
+
"sources": [
|
|
21
|
+
"events.js"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"data-ln-field": {
|
|
25
|
+
"direction": "author",
|
|
26
|
+
"sources": [
|
|
27
|
+
"template.js"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"data-ln-fill-as": {
|
|
31
|
+
"direction": "author",
|
|
32
|
+
"sources": [
|
|
33
|
+
"form.js"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"data-ln-fillable": {
|
|
37
|
+
"direction": "author",
|
|
38
|
+
"sources": [
|
|
39
|
+
"template.js"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"data-ln-filter": {
|
|
43
|
+
"direction": "author",
|
|
44
|
+
"sources": [
|
|
45
|
+
"hash.js"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"data-ln-form": {
|
|
49
|
+
"direction": "author",
|
|
50
|
+
"sources": [
|
|
51
|
+
"template.js"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"data-ln-hash": {
|
|
55
|
+
"direction": "author",
|
|
56
|
+
"sources": [
|
|
57
|
+
"hash.js"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"data-ln-persist": {
|
|
61
|
+
"direction": "author",
|
|
62
|
+
"sources": [
|
|
63
|
+
"lifecycle.js"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"data-ln-render-key": {
|
|
67
|
+
"direction": "both",
|
|
68
|
+
"sources": [
|
|
69
|
+
"template.js"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"data-ln-search": {
|
|
73
|
+
"direction": "author",
|
|
74
|
+
"sources": [
|
|
75
|
+
"hash.js"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"data-ln-search-for": {
|
|
79
|
+
"direction": "author",
|
|
80
|
+
"sources": [
|
|
81
|
+
"hash.js"
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
"data-ln-show": {
|
|
85
|
+
"direction": "author",
|
|
86
|
+
"sources": [
|
|
87
|
+
"template.js"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
"data-ln-sort": {
|
|
91
|
+
"direction": "author",
|
|
92
|
+
"sources": [
|
|
93
|
+
"hash.js"
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
"data-ln-template": {
|
|
97
|
+
"direction": "author",
|
|
98
|
+
"sources": [
|
|
99
|
+
"template.js"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"data-ln-value": {
|
|
103
|
+
"direction": "author",
|
|
104
|
+
"sources": [
|
|
105
|
+
"dom.js"
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { dispatch } from './events.js';
|
|
2
|
+
import { guardBody } from './dom.js';
|
|
3
|
+
|
|
4
|
+
// ─── Locale Detection ─────────────────────────────────────
|
|
5
|
+
|
|
6
|
+
export function getLocale(el) {
|
|
7
|
+
const langEl = el ? el.closest('[lang]') : null;
|
|
8
|
+
const raw = (langEl ? (langEl.getAttribute('lang') || langEl.lang) : null)
|
|
9
|
+
|| (typeof document !== 'undefined' && document.documentElement ? (document.documentElement.getAttribute('lang') || document.documentElement.lang) : null)
|
|
10
|
+
|| (typeof navigator !== 'undefined' ? navigator.language : null);
|
|
11
|
+
return raw ? raw.trim() : 'en-US';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// ─── Shared Locale-Change Broadcaster ─────────────────────
|
|
15
|
+
|
|
16
|
+
export function ensureLocaleObserver() {
|
|
17
|
+
if (typeof window === 'undefined') return;
|
|
18
|
+
window.lnCore = window.lnCore || {};
|
|
19
|
+
if (window.lnCore._localeObserverBound) return;
|
|
20
|
+
window.lnCore._localeObserverBound = true;
|
|
21
|
+
|
|
22
|
+
guardBody(function () {
|
|
23
|
+
const observer = new MutationObserver(function () {
|
|
24
|
+
dispatch(document, 'ln-core:locale-change', {});
|
|
25
|
+
});
|
|
26
|
+
observer.observe(document.documentElement, {
|
|
27
|
+
attributes: true,
|
|
28
|
+
attributeFilter: ['lang'],
|
|
29
|
+
subtree: true
|
|
30
|
+
});
|
|
31
|
+
}, 'ln-core');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// ─── Locale Fallback Registry ───────────────────────────────
|
|
35
|
+
const _localeFallbacks = {};
|
|
36
|
+
|
|
37
|
+
export function registerLocaleFallback(langPrefix, dictionary) {
|
|
38
|
+
if (!langPrefix || typeof dictionary !== 'object') return;
|
|
39
|
+
const prefix = langPrefix.toLowerCase().split('-')[0];
|
|
40
|
+
_localeFallbacks[prefix] = dictionary;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function getLocaleFallback(lang) {
|
|
44
|
+
if (!lang) return null;
|
|
45
|
+
const prefix = lang.toLowerCase().split('-')[0];
|
|
46
|
+
return _localeFallbacks[prefix] || null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
if (typeof window !== 'undefined') {
|
|
51
|
+
window.lnCore = window.lnCore || {};
|
|
52
|
+
window.lnCore.registerLocaleFallback = registerLocaleFallback;
|
|
53
|
+
window.lnCore.getLocaleFallback = getLocaleFallback;
|
|
54
|
+
window.lnCore.ensureLocaleObserver = ensureLocaleObserver;
|
|
55
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes a search query string for matching.
|
|
3
|
+
* @param {unknown} value
|
|
4
|
+
* @returns {string}
|
|
5
|
+
*/
|
|
6
|
+
export function normalizeSearchTerm(value) {
|
|
7
|
+
return String(value || '').trim().toLowerCase();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Splits query string into individual tokens for AND-based substring matching.
|
|
12
|
+
* @param {unknown} term
|
|
13
|
+
* @returns {string[]}
|
|
14
|
+
*/
|
|
15
|
+
export function tokenizeSearchQuery(term) {
|
|
16
|
+
const normalized = normalizeSearchTerm(term);
|
|
17
|
+
if (!normalized) return [];
|
|
18
|
+
return normalized.split(/\s+/).filter(Boolean);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Parses comma-separated field selectors forwarded to consumers.
|
|
23
|
+
* @param {unknown} rawFields
|
|
24
|
+
* @returns {string[]|null}
|
|
25
|
+
*/
|
|
26
|
+
export function parseSearchFields(rawFields) {
|
|
27
|
+
if (rawFields === null || rawFields === undefined) return null;
|
|
28
|
+
const fields = String(rawFields)
|
|
29
|
+
.split(',')
|
|
30
|
+
.map(f => f.trim())
|
|
31
|
+
.filter(Boolean);
|
|
32
|
+
return fields.length ? fields : null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Checks if text contains all tokens (AND-matching, order-independent).
|
|
37
|
+
* @param {string} text
|
|
38
|
+
* @param {string[]} tokens
|
|
39
|
+
* @returns {boolean}
|
|
40
|
+
*/
|
|
41
|
+
export function matchesSearchTokens(text, tokens) {
|
|
42
|
+
if (!tokens || tokens.length === 0) return true;
|
|
43
|
+
if (!text) return false;
|
|
44
|
+
const lower = String(text).toLowerCase();
|
|
45
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
46
|
+
if (lower.indexOf(tokens[i]) === -1) return false;
|
|
47
|
+
}
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Collapses collected text parts into normalized search index text.
|
|
53
|
+
* @param {string[]} parts
|
|
54
|
+
* @returns {string}
|
|
55
|
+
*/
|
|
56
|
+
export function collapseSearchParts(parts) {
|
|
57
|
+
if (!parts || parts.length === 0) return '';
|
|
58
|
+
return parts.join(' ').replace(/\s+/g, ' ').trim().toLowerCase();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Evaluates whether a cell or attribute value matches any of the filter's values (OR logic).
|
|
63
|
+
* @param {unknown} value
|
|
64
|
+
* @param {string[]} filterValues
|
|
65
|
+
* @returns {boolean}
|
|
66
|
+
*/
|
|
67
|
+
export function matchesFilterValues(value, filterValues) {
|
|
68
|
+
if (!filterValues || filterValues.length === 0) return true;
|
|
69
|
+
if (value === null || value === undefined) return false;
|
|
70
|
+
|
|
71
|
+
const lowerVal = String(value).trim().toLowerCase();
|
|
72
|
+
for (let i = 0; i < filterValues.length; i++) {
|
|
73
|
+
if (String(filterValues[i]).trim().toLowerCase() === lowerVal) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
}
|