@livenetworks/ashlar 2.0.6 → 2.0.8

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.
Files changed (221) hide show
  1. package/LICENSE +641 -641
  2. package/components/COMPONENTS.md +1116 -1116
  3. package/components/index.js +81 -81
  4. package/components/ln-accordion/ln-accordion-dev.scss +8 -8
  5. package/components/ln-accordion/ln-accordion.js +1 -1
  6. package/components/ln-accordion/ln-accordion.schema.json +30 -30
  7. package/components/ln-accordion/src/ln-accordion.js +1 -0
  8. package/components/ln-ajax/ln-ajax-dev.scss +8 -8
  9. package/components/ln-ajax/ln-ajax.js +1 -1
  10. package/components/ln-ajax/ln-ajax.schema.json +30 -30
  11. package/components/ln-api-connector/ln-api-connector.js +1 -1
  12. package/components/ln-api-connector/ln-api-connector.schema.json +96 -96
  13. package/components/ln-api-connector/src/ln-api-connector.js +1 -0
  14. package/components/ln-api-queue/ln-api-queue.js +1 -1
  15. package/components/ln-api-queue/ln-api-queue.schema.json +34 -34
  16. package/components/ln-api-queue/src/ln-api-queue.js +3 -13
  17. package/components/ln-autoresize/ln-autoresize-dev.scss +8 -8
  18. package/components/ln-autoresize/ln-autoresize.js +1 -1
  19. package/components/ln-autoresize/ln-autoresize.schema.json +22 -22
  20. package/components/ln-autosave/ln-autosave-dev.scss +13 -13
  21. package/components/ln-autosave/ln-autosave.js +1 -1
  22. package/components/ln-autosave/ln-autosave.schema.json +48 -48
  23. package/components/ln-autosave/src/autosave-model.js +34 -34
  24. package/components/ln-chart/ln-chart.js +1 -1
  25. package/components/ln-chart/ln-chart.schema.json +146 -146
  26. package/components/ln-chart/src/chart-model.js +154 -154
  27. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  28. package/components/ln-circular-progress/ln-circular-progress.schema.json +42 -42
  29. package/components/ln-confirm/ln-confirm-dev.scss +24 -24
  30. package/components/ln-confirm/ln-confirm.js +1 -1
  31. package/components/ln-confirm/ln-confirm.schema.json +66 -66
  32. package/components/ln-confirm/src/ln-confirm.js +178 -178
  33. package/components/ln-core/crypto.js +286 -265
  34. package/components/ln-core/dom.js +115 -115
  35. package/components/ln-core/form.js +136 -136
  36. package/components/ln-core/helpers.js +33 -33
  37. package/components/ln-core/http.js +48 -48
  38. package/components/ln-core/index.js +1 -1
  39. package/components/ln-core/ln-core.schema.json +109 -109
  40. package/components/ln-core/locale.js +55 -55
  41. package/components/ln-core/matching.js +78 -78
  42. package/components/ln-core/number.js +125 -125
  43. package/components/ln-core/template.js +206 -206
  44. package/components/ln-couchdb-connector/README.md +4 -0
  45. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  46. package/components/ln-couchdb-connector/ln-couchdb-connector.schema.json +50 -50
  47. package/components/ln-couchdb-connector/src/ln-couchdb-connector.js +19 -1
  48. package/components/ln-data-coordinator/README.md +9 -38
  49. package/components/ln-data-coordinator/ln-data-coordinator-dev.scss +8 -8
  50. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
  51. package/components/ln-data-coordinator/ln-data-coordinator.schema.json +16 -16
  52. package/components/ln-data-coordinator/src/data-read-policy.js +0 -7
  53. package/components/ln-data-coordinator/src/ln-data-coordinator.js +428 -1299
  54. package/components/ln-data-store/README.md +3 -2
  55. package/components/ln-data-store/ln-data-store-dev.scss +13 -13
  56. package/components/ln-data-store/ln-data-store.js +1 -1
  57. package/components/ln-data-store/ln-data-store.schema.json +84 -84
  58. package/components/ln-data-store/src/data-store-model.js +184 -155
  59. package/components/ln-data-store/src/ln-data-store.js +58 -11
  60. package/components/ln-date/README.md +4 -0
  61. package/components/ln-date/ln-date.js +1 -1
  62. package/components/ln-date/ln-date.schema.json +92 -92
  63. package/components/ln-date/src/date-model.js +186 -186
  64. package/components/ln-date/src/ln-date.js +3 -3
  65. package/components/ln-debug/ln-debug.js +1 -1
  66. package/components/ln-debug/ln-debug.schema.json +28 -28
  67. package/components/ln-debug/src/console-sink.js +19 -19
  68. package/components/ln-debug/src/gate.js +95 -95
  69. package/components/ln-debug/src/generated-attributes.js +2 -2
  70. package/components/ln-dropdown/ln-dropdown-dev.scss +13 -13
  71. package/components/ln-dropdown/ln-dropdown.js +1 -1
  72. package/components/ln-dropdown/ln-dropdown.schema.json +90 -90
  73. package/components/ln-editor/ln-editor.js +1 -1
  74. package/components/ln-editor/ln-editor.schema.json +58 -58
  75. package/components/ln-external-links/ln-external-links.js +1 -1
  76. package/components/ln-external-links/ln-external-links.schema.json +18 -18
  77. package/components/ln-fill/ln-fill.js +1 -1
  78. package/components/ln-fill/ln-fill.schema.json +23 -23
  79. package/components/ln-filter/ln-filter.js +1 -1
  80. package/components/ln-filter/ln-filter.schema.json +153 -153
  81. package/components/ln-filter/src/filter-model.js +185 -185
  82. package/components/ln-form/ln-form-dev.scss +8 -8
  83. package/components/ln-form/ln-form.js +1 -1
  84. package/components/ln-form/ln-form.schema.json +45 -45
  85. package/components/ln-http/ln-http.js +1 -1
  86. package/components/ln-http/ln-http.schema.json +6 -6
  87. package/components/ln-icon/ln-icon.schema.json +6 -6
  88. package/components/ln-include/ln-include.js +1 -1
  89. package/components/ln-include/ln-include.schema.json +23 -23
  90. package/components/ln-key/ln-key-dev.scss +18 -18
  91. package/components/ln-key/ln-key.js +1 -1
  92. package/components/ln-key/ln-key.schema.json +56 -56
  93. package/components/ln-key/src/ln-key.js +10 -10
  94. package/components/ln-link/ln-link-dev.scss +8 -8
  95. package/components/ln-link/ln-link.js +1 -1
  96. package/components/ln-link/ln-link.schema.json +22 -22
  97. package/components/ln-list/README.md +152 -152
  98. package/components/ln-list/ln-list-dev.scss +8 -8
  99. package/components/ln-list/ln-list.js +1 -1
  100. package/components/ln-list/ln-list.schema.json +166 -166
  101. package/components/ln-list/src/ln-list.js +4 -4
  102. package/components/ln-modal/README.md +4 -6
  103. package/components/ln-modal/ln-modal.js +1 -1
  104. package/components/ln-modal/ln-modal.schema.json +65 -65
  105. package/components/ln-modal/src/ln-modal.js +28 -8
  106. package/components/ln-nav/ln-nav.js +1 -1
  107. package/components/ln-nav/ln-nav.schema.json +25 -25
  108. package/components/ln-number/ln-number.js +1 -1
  109. package/components/ln-number/ln-number.schema.json +63 -63
  110. package/components/ln-number/src/number-model.js +31 -31
  111. package/components/ln-obfuscator/README.md +60 -60
  112. package/components/ln-obfuscator/ln-obfuscator.js +1 -1
  113. package/components/ln-obfuscator/ln-obfuscator.schema.json +49 -49
  114. package/components/ln-obfuscator/src/ln-obfuscator.js +159 -159
  115. package/components/ln-obfuscator/src/obfuscator-model.js +250 -250
  116. package/components/ln-options/ln-options.js +1 -1
  117. package/components/ln-options/ln-options.schema.json +41 -41
  118. package/components/ln-options/src/ln-options.js +1 -0
  119. package/components/ln-persist/README.md +151 -151
  120. package/components/ln-persist/ln-persist.js +1 -1
  121. package/components/ln-persist/ln-persist.schema.json +28 -28
  122. package/components/ln-persist/src/ln-persist.js +83 -83
  123. package/components/ln-picklist/README.md +230 -230
  124. package/components/ln-picklist/ln-picklist-dev.scss +22 -22
  125. package/components/ln-picklist/ln-picklist.js +1 -1
  126. package/components/ln-picklist/ln-picklist.schema.json +49 -49
  127. package/components/ln-picklist/src/ln-picklist.js +228 -228
  128. package/components/ln-popover/README.md +4 -0
  129. package/components/ln-popover/ln-popover-dev.scss +13 -13
  130. package/components/ln-popover/ln-popover.js +1 -1
  131. package/components/ln-popover/ln-popover.schema.json +82 -82
  132. package/components/ln-popover/src/ln-popover.js +9 -0
  133. package/components/ln-progress/ln-progress-dev.scss +8 -8
  134. package/components/ln-progress/ln-progress.js +1 -1
  135. package/components/ln-progress/ln-progress.schema.json +40 -40
  136. package/components/ln-router/ln-router.js +1 -1
  137. package/components/ln-router/ln-router.schema.json +76 -76
  138. package/components/ln-scroll/README.md +45 -45
  139. package/components/ln-scroll/ln-scroll.js +1 -1
  140. package/components/ln-scroll/ln-scroll.schema.json +85 -85
  141. package/components/ln-scroll/src/ln-scroll.js +150 -150
  142. package/components/ln-search/README.md +188 -188
  143. package/components/ln-search/ln-search.js +1 -1
  144. package/components/ln-search/ln-search.schema.json +103 -103
  145. package/components/ln-slug/ln-slug.js +1 -1
  146. package/components/ln-slug/ln-slug.schema.json +23 -23
  147. package/components/ln-sort/ln-sort.js +1 -1
  148. package/components/ln-sort/ln-sort.schema.json +104 -104
  149. package/components/ln-sort/src/ln-sort.js +321 -321
  150. package/components/ln-sort/src/sort-model.js +117 -117
  151. package/components/ln-sortable/ln-sortable-dev.scss +13 -13
  152. package/components/ln-sortable/ln-sortable.js +1 -1
  153. package/components/ln-sortable/ln-sortable.schema.json +36 -36
  154. package/components/ln-stat/ln-stat-dev.scss +8 -8
  155. package/components/ln-stat/ln-stat.js +1 -1
  156. package/components/ln-stat/ln-stat.schema.json +32 -32
  157. package/components/ln-stat/src/stat-model.js +28 -28
  158. package/components/ln-table/ln-table.js +1 -1
  159. package/components/ln-table/ln-table.schema.json +211 -211
  160. package/components/ln-table/src/ln-table.js +2 -0
  161. package/components/ln-table/src/table-model.js +98 -98
  162. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  163. package/components/ln-table-coordinator/ln-table-coordinator.schema.json +93 -93
  164. package/components/ln-table-coordinator/src/ln-table-coordinator.js +3 -3
  165. package/components/ln-tabs/README.md +2 -2
  166. package/components/ln-tabs/ln-tabs.js +1 -1
  167. package/components/ln-tabs/ln-tabs.schema.json +75 -75
  168. package/components/ln-tabs/src/ln-tabs.js +208 -207
  169. package/components/ln-tabs/src/tabs-model.js +82 -82
  170. package/components/ln-time/ln-time-dev.scss +13 -13
  171. package/components/ln-time/ln-time.js +1 -1
  172. package/components/ln-time/ln-time.schema.json +38 -38
  173. package/components/ln-toast/ln-toast.js +1 -1
  174. package/components/ln-toast/ln-toast.schema.json +65 -65
  175. package/components/ln-toggle/ln-toggle.js +1 -1
  176. package/components/ln-toggle/ln-toggle.schema.json +52 -52
  177. package/components/ln-tooltip/ln-tooltip.js +1 -1
  178. package/components/ln-tooltip/ln-tooltip.schema.json +86 -86
  179. package/components/ln-translations/ln-translations.js +1 -1
  180. package/components/ln-translations/ln-translations.schema.json +120 -120
  181. package/components/ln-ui-coordinator/README.md +62 -62
  182. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  183. package/components/ln-ui-coordinator/ln-ui-coordinator.schema.json +28 -28
  184. package/components/ln-ui-coordinator/src/ln-ui-coordinator.js +140 -140
  185. package/components/ln-upload/ln-upload.js +1 -1
  186. package/components/ln-upload/ln-upload.schema.json +193 -193
  187. package/components/ln-upload/src/upload-model.js +78 -78
  188. package/components/ln-validate/ln-validate.js +1 -1
  189. package/components/ln-validate/ln-validate.schema.json +50 -50
  190. package/components/ln-validate/src/validate-model.js +64 -64
  191. package/components/ln-websocket-connector/README.md +166 -166
  192. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  193. package/components/ln-websocket-connector/ln-websocket-connector.schema.json +29 -29
  194. package/components/ln-websocket-connector/src/ln-websocket-connector.js +283 -279
  195. package/ln-ashlar.html-data.json +7 -8
  196. package/package.json +84 -84
  197. package/theme/brand.css +73 -73
  198. package/theme/components/_confirm.scss +6 -6
  199. package/theme/components/_picklist.scss +3 -3
  200. package/theme/config/_palette.scss +274 -274
  201. package/theme/config/_theme.scss +292 -292
  202. package/theme/config/_tokens.scss +285 -285
  203. package/theme/config/mixins/_index.scss +62 -62
  204. package/theme/config/mixins/_picklist.scss +66 -66
  205. package/theme/ln-ashlar-dev.scss +66 -66
  206. package/theme/ln-ashlar-landing.scss +56 -56
  207. package/theme/ln-ashlar-theme.scss +63 -63
  208. package/theme/presentation/_bento.scss +151 -151
  209. package/theme/presentation/_cta.scss +111 -111
  210. package/theme/presentation/_effects.scss +216 -216
  211. package/theme/presentation/_features.scss +108 -108
  212. package/theme/presentation/_footer.scss +129 -129
  213. package/theme/presentation/_hero.scss +158 -158
  214. package/theme/presentation/_layout.scss +170 -170
  215. package/theme/presentation/_navbar.scss +140 -140
  216. package/theme/presentation/_pricing.scss +262 -262
  217. package/theme/presentation/_stats.scss +87 -87
  218. package/theme/presentation/_testimonials.scss +124 -124
  219. package/theme/presentation/_tokens.scss +39 -39
  220. package/theme/presentation/_typography.scss +163 -163
  221. package/web-types.json +12 -12
@@ -1,117 +1,117 @@
1
- import { compareValues } from '../../ln-core/compare.js';
2
-
3
- export const SORT_DIRECTIONS = ['none', 'asc', 'desc'];
4
-
5
- /**
6
- * Normalizes a sort direction string to 'asc', 'desc', or 'none'.
7
- * @param {unknown} value
8
- * @returns {'asc' | 'desc' | 'none'}
9
- */
10
- export function normalizeSortDirection(value) {
11
- const str = String(value || '').trim().toLowerCase();
12
- if (str === 'asc' || str === 'ascending') return 'asc';
13
- if (str === 'desc' || str === 'descending') return 'desc';
14
- return 'none';
15
- }
16
-
17
- /**
18
- * Returns the ARIA sort attribute value corresponding to the direction.
19
- * @param {unknown} direction
20
- * @returns {'ascending' | 'descending' | 'none'}
21
- */
22
- export function getAriaSortValue(direction) {
23
- const normalized = normalizeSortDirection(direction);
24
- if (normalized === 'asc') return 'ascending';
25
- if (normalized === 'desc') return 'descending';
26
- return 'none';
27
- }
28
-
29
- /**
30
- * Determines whether two sort targets represent the identical sort key.
31
- * @param {{ field?: string|null, column?: number|string|null }} a
32
- * @param {{ field?: string|null, column?: number|string|null }} b
33
- * @returns {boolean}
34
- */
35
- export function isSameSortTarget(a, b) {
36
- if (!a || !b) return false;
37
- if (a.field !== null && a.field !== undefined && b.field !== null && b.field !== undefined) {
38
- return a.field === b.field;
39
- }
40
- if (a.column !== null && a.column !== undefined && b.column !== null && b.column !== undefined) {
41
- return String(a.column) === String(b.column);
42
- }
43
- return false;
44
- }
45
-
46
- /**
47
- * Creates a sort comparator function for sorting an array of records/items.
48
- * @param {'asc' | 'desc' | 'none'} direction
49
- * @param {'number' | 'string'} valueType
50
- * @param {Intl.Collator|null} [collator]
51
- * @param {(item: any) => any} [getValueFn]
52
- * @returns {(a: any, b: any) => number}
53
- */
54
- export function createSortComparator(direction, valueType, collator, getValueFn) {
55
- const normalized = normalizeSortDirection(direction);
56
- if (normalized === 'none') return () => 0;
57
-
58
- const multiplier = normalized === 'desc' ? -1 : 1;
59
- const getter = typeof getValueFn === 'function' ? getValueFn : (item) => item;
60
-
61
- return function (a, b) {
62
- const valA = getter(a);
63
- const valB = getter(b);
64
- return compareValues(valA, valB, valueType, collator) * multiplier;
65
- };
66
- }
67
-
68
- /**
69
- * Determines whether a DOM element should be excluded from sorting (e.g. empty-state, hidden rows, templates).
70
- * @param {Element|unknown} el
71
- * @returns {boolean}
72
- */
73
- export function isExcludedSortItem(el) {
74
- if (!el || typeof el !== 'object' || el.nodeType !== 1) return true;
75
- if (el.tagName === 'TEMPLATE') return true;
76
- if (typeof el.hasAttribute === 'function') {
77
- if (el.hasAttribute('data-ln-sort-exclude') || el.hasAttribute('hidden')) return true;
78
- }
79
- if (el.classList && el.classList.contains('hidden')) return true;
80
- if (el.style && el.style.display === 'none') return true;
81
- if (typeof el.matches === 'function') {
82
- if (el.matches('.empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]')) {
83
- return true;
84
- }
85
- }
86
- return false;
87
- }
88
-
89
- /**
90
- * Resolves the list of sortable DOM items from a target element.
91
- * For tables without explicit selector, automatically targets the tbody rows.
92
- * @param {Element|unknown} target
93
- * @param {string|null} [itemsSelector]
94
- * @returns {Element[]}
95
- */
96
- export function resolveSortItems(target, itemsSelector) {
97
- if (!target || typeof target !== 'object' || target.nodeType !== 1) return [];
98
- const selector = itemsSelector
99
- || (typeof target.getAttribute === 'function' ? target.getAttribute('data-ln-sort-items') : null)
100
- || null;
101
- if (selector && typeof target.querySelectorAll === 'function') {
102
- return Array.from(target.querySelectorAll(selector));
103
- }
104
- if (target.tagName === 'TABLE') {
105
- const tbody = target.tBodies && target.tBodies.length
106
- ? target.tBodies[0]
107
- : (typeof target.querySelector === 'function' ? target.querySelector('tbody') : null);
108
- if (tbody) {
109
- return Array.from(tbody.children || []);
110
- }
111
- if (typeof target.querySelectorAll === 'function') {
112
- return Array.from(target.querySelectorAll('tbody tr, tr'));
113
- }
114
- }
115
- return Array.from(target.children || []);
116
- }
117
-
1
+ import { compareValues } from '../../ln-core/compare.js';
2
+
3
+ export const SORT_DIRECTIONS = ['none', 'asc', 'desc'];
4
+
5
+ /**
6
+ * Normalizes a sort direction string to 'asc', 'desc', or 'none'.
7
+ * @param {unknown} value
8
+ * @returns {'asc' | 'desc' | 'none'}
9
+ */
10
+ export function normalizeSortDirection(value) {
11
+ const str = String(value || '').trim().toLowerCase();
12
+ if (str === 'asc' || str === 'ascending') return 'asc';
13
+ if (str === 'desc' || str === 'descending') return 'desc';
14
+ return 'none';
15
+ }
16
+
17
+ /**
18
+ * Returns the ARIA sort attribute value corresponding to the direction.
19
+ * @param {unknown} direction
20
+ * @returns {'ascending' | 'descending' | 'none'}
21
+ */
22
+ export function getAriaSortValue(direction) {
23
+ const normalized = normalizeSortDirection(direction);
24
+ if (normalized === 'asc') return 'ascending';
25
+ if (normalized === 'desc') return 'descending';
26
+ return 'none';
27
+ }
28
+
29
+ /**
30
+ * Determines whether two sort targets represent the identical sort key.
31
+ * @param {{ field?: string|null, column?: number|string|null }} a
32
+ * @param {{ field?: string|null, column?: number|string|null }} b
33
+ * @returns {boolean}
34
+ */
35
+ export function isSameSortTarget(a, b) {
36
+ if (!a || !b) return false;
37
+ if (a.field !== null && a.field !== undefined && b.field !== null && b.field !== undefined) {
38
+ return a.field === b.field;
39
+ }
40
+ if (a.column !== null && a.column !== undefined && b.column !== null && b.column !== undefined) {
41
+ return String(a.column) === String(b.column);
42
+ }
43
+ return false;
44
+ }
45
+
46
+ /**
47
+ * Creates a sort comparator function for sorting an array of records/items.
48
+ * @param {'asc' | 'desc' | 'none'} direction
49
+ * @param {'number' | 'string'} valueType
50
+ * @param {Intl.Collator|null} [collator]
51
+ * @param {(item: any) => any} [getValueFn]
52
+ * @returns {(a: any, b: any) => number}
53
+ */
54
+ export function createSortComparator(direction, valueType, collator, getValueFn) {
55
+ const normalized = normalizeSortDirection(direction);
56
+ if (normalized === 'none') return () => 0;
57
+
58
+ const multiplier = normalized === 'desc' ? -1 : 1;
59
+ const getter = typeof getValueFn === 'function' ? getValueFn : (item) => item;
60
+
61
+ return function (a, b) {
62
+ const valA = getter(a);
63
+ const valB = getter(b);
64
+ return compareValues(valA, valB, valueType, collator) * multiplier;
65
+ };
66
+ }
67
+
68
+ /**
69
+ * Determines whether a DOM element should be excluded from sorting (e.g. empty-state, hidden rows, templates).
70
+ * @param {Element|unknown} el
71
+ * @returns {boolean}
72
+ */
73
+ export function isExcludedSortItem(el) {
74
+ if (!el || typeof el !== 'object' || el.nodeType !== 1) return true;
75
+ if (el.tagName === 'TEMPLATE') return true;
76
+ if (typeof el.hasAttribute === 'function') {
77
+ if (el.hasAttribute('data-ln-sort-exclude') || el.hasAttribute('hidden')) return true;
78
+ }
79
+ if (el.classList && el.classList.contains('hidden')) return true;
80
+ if (el.style && el.style.display === 'none') return true;
81
+ if (typeof el.matches === 'function') {
82
+ if (el.matches('.empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]')) {
83
+ return true;
84
+ }
85
+ }
86
+ return false;
87
+ }
88
+
89
+ /**
90
+ * Resolves the list of sortable DOM items from a target element.
91
+ * For tables without explicit selector, automatically targets the tbody rows.
92
+ * @param {Element|unknown} target
93
+ * @param {string|null} [itemsSelector]
94
+ * @returns {Element[]}
95
+ */
96
+ export function resolveSortItems(target, itemsSelector) {
97
+ if (!target || typeof target !== 'object' || target.nodeType !== 1) return [];
98
+ const selector = itemsSelector
99
+ || (typeof target.getAttribute === 'function' ? target.getAttribute('data-ln-sort-items') : null)
100
+ || null;
101
+ if (selector && typeof target.querySelectorAll === 'function') {
102
+ return Array.from(target.querySelectorAll(selector));
103
+ }
104
+ if (target.tagName === 'TABLE') {
105
+ const tbody = target.tBodies && target.tBodies.length
106
+ ? target.tBodies[0]
107
+ : (typeof target.querySelector === 'function' ? target.querySelector('tbody') : null);
108
+ if (tbody) {
109
+ return Array.from(tbody.children || []);
110
+ }
111
+ if (typeof target.querySelectorAll === 'function') {
112
+ return Array.from(target.querySelectorAll('tbody tr, tr'));
113
+ }
114
+ }
115
+ return Array.from(target.children || []);
116
+ }
117
+
@@ -1,13 +1,13 @@
1
- @use '../../theme/config/mixins' as *;
2
-
3
- [data-ln-debug] {
4
- // 1. Host Container Check: data-ln-sortable belongs on list or grid containers
5
- [data-ln-sortable]:not(ul, ol, div, tbody) {
6
- @include dev-inline-error("data-ln-sortable belongs on <ul>, <ol>, <tbody>, or <div> containers");
7
- }
8
-
9
- // 2. Handle Nesting Check: sortable handles must be inside a sortable container
10
- [data-ln-sortable-handle]:not([data-ln-sortable] *) {
11
- @include dev-inline-error("[data-ln-sortable-handle] is orphaned (not inside a [data-ln-sortable] container)");
12
- }
13
- }
1
+ @use '../../theme/config/mixins' as *;
2
+
3
+ [data-ln-debug] {
4
+ // 1. Host Container Check: data-ln-sortable belongs on list or grid containers
5
+ [data-ln-sortable]:not(ul, ol, div, tbody) {
6
+ @include dev-inline-error("data-ln-sortable belongs on <ul>, <ol>, <tbody>, or <div> containers");
7
+ }
8
+
9
+ // 2. Handle Nesting Check: sortable handles must be inside a sortable container
10
+ [data-ln-sortable-handle]:not([data-ln-sortable] *) {
11
+ @include dev-inline-error("[data-ln-sortable-handle] is orphaned (not inside a [data-ln-sortable] container)");
12
+ }
13
+ }
@@ -1 +1 @@
1
- (function(){"use strict";function O(){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 y(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 i=null;for(let s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){i=t[s];break}if(!y(i))return}e.apply(console,t)}}function C(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function j(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(s),s}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const D={};function N(e,t){D[e]=t}function P(e){return D[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=N,window.lnCore.getDataMapper=P);function V(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){C(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const T={};function H(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];T[n]=t}function U(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=H,window.lnCore.getLocaleFallback=U,window.lnCore.ensureLocaleObserver=V);const A={};function Q(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 $(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const l=n[o],r=l.getAttribute("data-ln-field");t[r]!=null&&(l.textContent=t[r])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const l=i[o],r=l.getAttribute("data-ln-attr").split(",");for(let a=0;a<r.length;a++){const c=r[a].trim().split(":");if(c.length!==2)continue;const u=c[0].trim(),f=c[1].trim();t[f]!=null&&l.setAttribute(u,t[f])}}const s=e.querySelectorAll("[data-ln-show]");for(let o=0;o<s.length;o++){const l=s[o],r=l.getAttribute("data-ln-show");r in t&&l.classList.toggle("hidden",!t[r])}const d=e.querySelectorAll("[data-ln-class]");for(let o=0;o<d.length;o++){const l=d[o],r=l.getAttribute("data-ln-class").split(",");for(let a=0;a<r.length;a++){const c=r[a].trim().split(":");if(c.length!==2)continue;const u=c[0].trim(),f=c[1].trim();f in t&&l.classList.toggle(u,!!t[f])}}return e}function K(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 i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[i].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)$(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 I(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const d=n.currentNode;d.textContent.indexOf("{{")!==-1&&(d.textContent=d.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,l){return t[l]!==void 0?t[l]:""}))}const i=function(d,o){return t[o]!==void 0?t[o]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let d=0;d<s.length;d++){const o=s[d],l=o.attributes;for(let r=0;r<l.length;r++){const a=l[r];a.value.indexOf("{{")!==-1&&o.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Y(e,t,n,i,s,d){const o={};for(let r=0;r<e.children.length;r++){const a=e.children[r],c=a.getAttribute("data-ln-render-key");c&&(o[c]=a)}const l=document.createDocumentFragment();for(let r=0;r<t.length;r++){const a=t[r],c=String(i(a));let u=o[c];if(u)s(u,a,r);else{const f=Q(n,d);if(!f||(I(f,a),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",c),s(u,a,r)}l.appendChild(u)}e.textContent="",e.appendChild(l)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=I,window.lnCore.fill=$,window.lnCore.lnFill=K,window.lnCore.renderList=Y);function R(e,t,n,i,s){if(!e||t===null)return!0;const d=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const l=r=>{s?console.warn(r,s):console.warn(r)};if(o==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(l(`[${d}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const r=e.values||[];return r.includes(t)?!0:(l(`[${d}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return l(`[${d}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(l(`[${d}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(l(`[${d}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(l(`[${d}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(r){return l(`[${d}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function G(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=i.effect)}return Object.keys(t).length?t:null}function J(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,i){if(e.nodeType!==1)return;const d=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o=Array.from(e.querySelectorAll(d));e.matches&&e.matches(d)&&o.push(e);for(const l of o)if(!l[n]){window.lnCore._persistSink&&l.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(l,t);try{l[n]=new i(l)}catch(r){console.error("["+n+"] init failed",l,r)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function X(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function z(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 q(){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 Z(e){const t=q(),n=e.observed||[];for(let i=0;i<n.length;i++){const s=n[i];t.byAttr.has(s)||t.byAttr.set(s,[]),t.byAttr.get(s).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const s=t.byDeclaredAttr.get(i);s.some(d=>d.componentTag===e.componentTag)||s.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=J(e);if(i===null)t.reactiveWildcard.push(e);else for(const s of i)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function M(e,t,n,i){for(let s=0;s<e.length;s++){const d=e[s];if(!t[d.attribute])continue;const o=d.effects&&d.effects[n];o?o(t,n,i):d.onAttrChange&&(!d.declared||d.declared.has(n))&&d.onAttrChange(t,n,i)}}function ee(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const i=q(),s=i.byAttr.get(n);if(O()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(n)&&y(t)){const d=i.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let l=0;l<d.length;l++)R(d[l].spec,o,n,d[l].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||s)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const d=i.byReactive.get(n);d&&M(d,t,n,e.oldValue),i.reactiveWildcard.length&&M(i.reactiveWildcard,t,n,e.oldValue)}if(s)for(let d=0;d<s.length;d++){const o=s[d];if(o.handler){o.handler(t,n,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,n):(v(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function te(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ee(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].target,i)}}).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 ne(e){const t=B();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const i=t[n];if(i.onSubtreeChange){const s=i.query,d=e.target.nodeType===1?e.target.matches(s)?e.target:e.target.closest(s):e.target.parentElement?e.target.parentElement.closest(s):null;d&&i.onSubtreeChange(d,e)}}for(let n=0;n<e.addedNodes.length;n++){const i=e.addedNodes[n];if(i.nodeType===1)for(let s=0;s<t.length;s++){const d=t[s];v(i,d.selector,d.attribute,d.ComponentFn),d.onInit&&d.onInit(i)}}for(let n=0;n<e.removedNodes.length;n++){const i=e.removedNodes[n];if(i.nodeType===1)for(let s=0;s<t.length;s++){const d=t[s],o=d.query,l=Array.from(i.querySelectorAll(o));i.matches&&i.matches(o)&&l.push(i);for(let r=0;r<l.length;r++){const a=l[r];if(!document.contains(a)){const c=a[d.attribute];if(c&&typeof c.destroy=="function")try{c.destroy()}catch(u){console.error("["+d.attribute+"] destroy failed",a,u)}delete a[d.attribute]}}}}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{ne(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function oe(e,t,n,i,s={}){const d=s.extraAttributes||[],o=s.onAttributeChange||null,l=s.onSubtreeChange||null,r=s.onInit||null,a=s.onAttrChange||null,c=s.effects||null,u=s.attributes||null,f=u?G(u):c,h=u?new Set(Object.keys(u)):null,g=s.persist||null;function b(k){const w=k||document.body;if(v(w,e,t,n),u&&O())for(const p in u){const be=u[p],S=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&S.push(w);for(let L=0;L<S.length;L++){const x=S[L];y(x)&&R(be,x.getAttribute(p),p,i,x)}}r&&r(w)}const E=[];if(e.indexOf("[")!==-1){const k=/\[([\w-]+)/g;let w;for(;(w=k.exec(e))!==null;)E.push(w[1])}else E.push(e);Z({selector:e,attribute:t,componentTag:i,attributes:u,ComponentFn:n,onInit:r,observed:E.concat(d),onAttributeChange:o,onAttrChange:a,effects:f,declared:h,persist:g}),te();const we=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";B().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:l,query:we}),re(),window[t]=b;function W(){X()>0?z(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",W):W(),b}function F(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,n={},i=F(t);if(!i)return n;const s=i.split("&");for(let d=0;d<s.length;d++){const o=s[d];if(!o)continue;const l=o.indexOf(":"),r=l>-1?o.slice(0,l):o,a=l>-1?o.slice(l+1):"";if(r)try{n[r]=decodeURIComponent(a)}catch{n[r]=a}}return n}function ie(e){if(!e)return null;const t=_();return e in t?t[e]:null}function le(e,t){if(!e)return;const n=_();t==null?delete n[e]:n[e]=String(t);const s=Object.keys(n).map(function(d){const o=n[d];return o===""?d:d+":"+encodeURIComponent(o)}).join("&");F(location.hash)!==s&&(location.hash=s)}function se(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function de(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 i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function ae(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ce(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 ue(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function fe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),s=i?i.split(",").map(function(d){try{return decodeURIComponent(d)}catch{return d}}).filter(Boolean):[];return{key:n,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=_,window.lnCore.hashGet=ie,window.lnCore.hashSet=le,window.lnCore.hashLinkClick=se,window.lnCore.resolveHashNamespace=de,window.lnCore.hashSortEncode=ae,window.lnCore.hashSortDecode=ce,window.lnCore.hashFilterEncode=ue,window.lnCore.hashFilterDecode=fe),(function(){const e="data-ln-sortable",t="lnSortable",n="data-ln-sortable-handle";if(window[t]!==void 0)return;const i={"data-ln-sortable":{effect:d,type:"enum",values:["enabled","disabled"],fallback:"enabled",description:"Enables drag-and-drop item reordering or disables when set to disabled"},"data-ln-sortable-handle":{type:"marker",description:"Designates an element as the drag handle for its parent sortable item"}};function s(o){this.dom=o,this.isEnabled=o.getAttribute(e)!=="disabled",this._dragging=null,o.setAttribute("aria-roledescription","sortable list");const l=this;return this._onPointerDown=function(r){l.isEnabled&&l._handlePointerDown(r)},o.addEventListener("pointerdown",this._onPointerDown),this}s.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("pointerdown",this._onPointerDown),delete this.dom[t])},s.prototype._handlePointerDown=function(o){let l=o.target.closest("["+n+"]"),r;if(l){for(r=l;r&&r.parentElement!==this.dom;)r=r.parentElement;if(!r||r.parentElement!==this.dom)return}else{if(this.dom.querySelector("["+n+"]"))return;for(r=o.target;r&&r.parentElement!==this.dom;)r=r.parentElement;if(!r||r.parentElement!==this.dom)return;l=r}const c=Array.from(this.dom.children).indexOf(r);if(j(this.dom,"ln-sortable:before-drag",{item:r,index:c}).defaultPrevented)return;o.preventDefault(),l.setPointerCapture(o.pointerId),this._dragging=r,r.classList.add("ln-sortable--dragging"),r.setAttribute("aria-grabbed","true"),this.dom.classList.add("ln-sortable--active"),C(this.dom,"ln-sortable:drag-start",{item:r,index:c});const f=this,h=function(b){f._handlePointerMove(b)},g=function(b){f._handlePointerEnd(b),l.removeEventListener("pointermove",h),l.removeEventListener("pointerup",g),l.removeEventListener("pointercancel",g)};l.addEventListener("pointermove",h),l.addEventListener("pointerup",g),l.addEventListener("pointercancel",g)},s.prototype._handlePointerMove=function(o){if(!this._dragging)return;const l=Array.from(this.dom.children),r=this._dragging;for(const a of l)a.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");for(const a of l){if(a===r)continue;const c=a.getBoundingClientRect(),u=c.top+c.height/2;if(o.clientY>=c.top&&o.clientY<u){a.classList.add("ln-sortable--drop-before");break}else if(o.clientY>=u&&o.clientY<=c.bottom){a.classList.add("ln-sortable--drop-after");break}}},s.prototype._handlePointerEnd=function(o){if(!this._dragging)return;const l=this._dragging,r=Array.from(this.dom.children),a=r.indexOf(l);let c=null,u=null;for(const f of r){if(f.classList.contains("ln-sortable--drop-before")){c=f,u="before";break}if(f.classList.contains("ln-sortable--drop-after")){c=f,u="after";break}}for(const f of r)f.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");if(l.classList.remove("ln-sortable--dragging"),l.removeAttribute("aria-grabbed"),this.dom.classList.remove("ln-sortable--active"),c&&c!==l){u==="before"?this.dom.insertBefore(l,c):this.dom.insertBefore(l,c.nextElementSibling);const h=Array.from(this.dom.children).indexOf(l);C(this.dom,"ln-sortable:reordered",{item:l,oldIndex:a,newIndex:h})}this._dragging=null};function d(o){const l=o[t];if(!l)return;const r=o.getAttribute(e)!=="disabled";r!==l.isEnabled&&(l.isEnabled=r,C(o,r?"ln-sortable:enabled":"ln-sortable:disabled",{target:o}))}oe(e,t,s,"ln-sortable",{attributes:i})})()})();
1
+ (function(){"use strict";function O(){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 y(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 i=null;for(let s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){i=t[s];break}if(!y(i))return}e.apply(console,t)}}function C(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function j(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(s),s}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const D={};function N(e,t){D[e]=t}function P(e){return D[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=N,window.lnCore.getDataMapper=P);function V(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){C(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const I={};function H(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];I[n]=t}function U(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return I[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=H,window.lnCore.getLocaleFallback=U,window.lnCore.ensureLocaleObserver=V);const A={};function Q(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 T(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const l=n[o],r=l.getAttribute("data-ln-field");t[r]!=null&&(l.textContent=t[r])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const l=i[o],r=l.getAttribute("data-ln-attr").split(",");for(let a=0;a<r.length;a++){const c=r[a].trim().split(":");if(c.length!==2)continue;const u=c[0].trim(),f=c[1].trim();t[f]!=null&&l.setAttribute(u,t[f])}}const s=e.querySelectorAll("[data-ln-show]");for(let o=0;o<s.length;o++){const l=s[o],r=l.getAttribute("data-ln-show");r in t&&l.classList.toggle("hidden",!t[r])}const d=e.querySelectorAll("[data-ln-class]");for(let o=0;o<d.length;o++){const l=d[o],r=l.getAttribute("data-ln-class").split(",");for(let a=0;a<r.length;a++){const c=r[a].trim().split(":");if(c.length!==2)continue;const u=c[0].trim(),f=c[1].trim();f in t&&l.classList.toggle(u,!!t[f])}}return e}function K(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 i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[i].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)T(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 $(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const d=n.currentNode;d.textContent.indexOf("{{")!==-1&&(d.textContent=d.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,l){return t[l]!==void 0?t[l]:""}))}const i=function(d,o){return t[o]!==void 0?t[o]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let d=0;d<s.length;d++){const o=s[d],l=o.attributes;for(let r=0;r<l.length;r++){const a=l[r];a.value.indexOf("{{")!==-1&&o.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Y(e,t,n,i,s,d){const o={};for(let r=0;r<e.children.length;r++){const a=e.children[r],c=a.getAttribute("data-ln-render-key");c&&(o[c]=a)}const l=document.createDocumentFragment();for(let r=0;r<t.length;r++){const a=t[r],c=String(i(a));let u=o[c];if(u)s(u,a,r);else{const f=Q(n,d);if(!f||($(f,a),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",c),s(u,a,r)}l.appendChild(u)}e.textContent="",e.appendChild(l)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=T,window.lnCore.lnFill=K,window.lnCore.renderList=Y);function M(e,t,n,i,s){if(!e||t===null)return!0;const d=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const l=r=>{s?console.warn(r,s):console.warn(r)};if(o==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(l(`[${d}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const r=e.values||[];return r.includes(t)?!0:(l(`[${d}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return l(`[${d}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(l(`[${d}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(l(`[${d}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(l(`[${d}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(r){return l(`[${d}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function G(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=i.effect)}return Object.keys(t).length?t:null}function J(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,i){if(e.nodeType!==1)return;const d=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o=Array.from(e.querySelectorAll(d));e.matches&&e.matches(d)&&o.push(e);for(const l of o)if(!l[n]){window.lnCore._persistSink&&l.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(l,t);try{l[n]=new i(l)}catch(r){console.error("["+n+"] init failed",l,r)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function X(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function z(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 Z(e){const t=R(),n=e.observed||[];for(let i=0;i<n.length;i++){const s=n[i];t.byAttr.has(s)||t.byAttr.set(s,[]),t.byAttr.get(s).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const s=t.byDeclaredAttr.get(i);s.some(d=>d.componentTag===e.componentTag)||s.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=J(e);if(i===null)t.reactiveWildcard.push(e);else for(const s of i)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function q(e,t,n,i){for(let s=0;s<e.length;s++){const d=e[s];if(!t[d.attribute])continue;const o=d.effects&&d.effects[n];o?o(t,n,i):d.onAttrChange&&(!d.declared||d.declared.has(n))&&d.onAttrChange(t,n,i)}}function ee(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const i=R(),s=i.byAttr.get(n);if(O()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(n)&&y(t)){const d=i.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let l=0;l<d.length;l++)M(d[l].spec,o,n,d[l].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||s)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const d=i.byReactive.get(n);d&&q(d,t,n,e.oldValue),i.reactiveWildcard.length&&q(i.reactiveWildcard,t,n,e.oldValue)}if(s)for(let d=0;d<s.length;d++){const o=s[d];if(o.handler){o.handler(t,n,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,n):(v(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function te(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ee(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].target,i)}}).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 ne(e){const t=B();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const i=t[n];if(i.onSubtreeChange){const s=i.query,d=e.target.nodeType===1?e.target.matches(s)?e.target:e.target.closest(s):e.target.parentElement?e.target.parentElement.closest(s):null;d&&i.onSubtreeChange(d,e)}}for(let n=0;n<e.addedNodes.length;n++){const i=e.addedNodes[n];if(i.nodeType===1)for(let s=0;s<t.length;s++){const d=t[s];v(i,d.selector,d.attribute,d.ComponentFn),d.onInit&&d.onInit(i)}}for(let n=0;n<e.removedNodes.length;n++){const i=e.removedNodes[n];if(i.nodeType===1)for(let s=0;s<t.length;s++){const d=t[s],o=d.query,l=Array.from(i.querySelectorAll(o));i.matches&&i.matches(o)&&l.push(i);for(let r=0;r<l.length;r++){const a=l[r];if(!document.contains(a)){const c=a[d.attribute];if(c&&typeof c.destroy=="function")try{c.destroy()}catch(u){console.error("["+d.attribute+"] destroy failed",a,u)}delete a[d.attribute]}}}}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{ne(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function oe(e,t,n,i,s={}){const d=s.extraAttributes||[],o=s.onAttributeChange||null,l=s.onSubtreeChange||null,r=s.onInit||null,a=s.onAttrChange||null,c=s.effects||null,u=s.attributes||null,f=u?G(u):c,h=u?new Set(Object.keys(u)):null,g=s.persist||null;function b(E){const w=E||document.body;if(v(w,e,t,n),u&&O())for(const p in u){const he=u[p],S=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&S.push(w);for(let k=0;k<S.length;k++){const L=S[k];y(L)&&M(he,L.getAttribute(p),p,i,L)}}r&&r(w)}const _=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let w;for(;(w=E.exec(e))!==null;)_.push(w[1])}else _.push(e);Z({selector:e,attribute:t,componentTag:i,attributes:u,ComponentFn:n,onInit:r,observed:_.concat(d),onAttributeChange:o,onAttrChange:a,effects:f,declared:h,persist:g}),te();const be=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";B().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:l,query:be}),re(),window[t]=b;function W(){X()>0?z(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",W):W(),b}function F(e){return(e||"").replace(/^#/,"")}function x(e){const t=e===void 0?location.hash:e,n={},i=F(t);if(!i)return n;const s=i.split("&");for(let d=0;d<s.length;d++){const o=s[d];if(!o)continue;const l=o.indexOf(":"),r=l>-1?o.slice(0,l):o,a=l>-1?o.slice(l+1):"";if(r)try{n[r]=decodeURIComponent(a)}catch{n[r]=a}}return n}function ie(e){if(!e)return null;const t=x();return e in t?t[e]:null}function le(e,t){if(!e)return;const n=x();t==null?delete n[e]:n[e]=String(t);const s=Object.keys(n).map(function(d){const o=n[d];return o===""?d:d+":"+encodeURIComponent(o)}).join("&");F(location.hash)!==s&&(location.hash=s)}function se(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function de(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 i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function ae(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ce(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 ue(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function fe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),s=i?i.split(",").map(function(d){try{return decodeURIComponent(d)}catch{return d}}).filter(Boolean):[];return{key:n,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=x,window.lnCore.hashGet=ie,window.lnCore.hashSet=le,window.lnCore.hashLinkClick=se,window.lnCore.resolveHashNamespace=de,window.lnCore.hashSortEncode=ae,window.lnCore.hashSortDecode=ce,window.lnCore.hashFilterEncode=ue,window.lnCore.hashFilterDecode=fe);function we(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=we),(function(){const e="data-ln-sortable",t="lnSortable",n="data-ln-sortable-handle";if(window[t]!==void 0)return;const i={"data-ln-sortable":{effect:d,type:"enum",values:["enabled","disabled"],fallback:"enabled",description:"Enables drag-and-drop item reordering or disables when set to disabled"},"data-ln-sortable-handle":{type:"marker",description:"Designates an element as the drag handle for its parent sortable item"}};function s(o){this.dom=o,this.isEnabled=o.getAttribute(e)!=="disabled",this._dragging=null,o.setAttribute("aria-roledescription","sortable list");const l=this;return this._onPointerDown=function(r){l.isEnabled&&l._handlePointerDown(r)},o.addEventListener("pointerdown",this._onPointerDown),this}s.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("pointerdown",this._onPointerDown),delete this.dom[t])},s.prototype._handlePointerDown=function(o){let l=o.target.closest("["+n+"]"),r;if(l){for(r=l;r&&r.parentElement!==this.dom;)r=r.parentElement;if(!r||r.parentElement!==this.dom)return}else{if(this.dom.querySelector("["+n+"]"))return;for(r=o.target;r&&r.parentElement!==this.dom;)r=r.parentElement;if(!r||r.parentElement!==this.dom)return;l=r}const c=Array.from(this.dom.children).indexOf(r);if(j(this.dom,"ln-sortable:before-drag",{item:r,index:c}).defaultPrevented)return;o.preventDefault(),l.setPointerCapture(o.pointerId),this._dragging=r,r.classList.add("ln-sortable--dragging"),r.setAttribute("aria-grabbed","true"),this.dom.classList.add("ln-sortable--active"),C(this.dom,"ln-sortable:drag-start",{item:r,index:c});const f=this,h=function(b){f._handlePointerMove(b)},g=function(b){f._handlePointerEnd(b),l.removeEventListener("pointermove",h),l.removeEventListener("pointerup",g),l.removeEventListener("pointercancel",g)};l.addEventListener("pointermove",h),l.addEventListener("pointerup",g),l.addEventListener("pointercancel",g)},s.prototype._handlePointerMove=function(o){if(!this._dragging)return;const l=Array.from(this.dom.children),r=this._dragging;for(const a of l)a.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");for(const a of l){if(a===r)continue;const c=a.getBoundingClientRect(),u=c.top+c.height/2;if(o.clientY>=c.top&&o.clientY<u){a.classList.add("ln-sortable--drop-before");break}else if(o.clientY>=u&&o.clientY<=c.bottom){a.classList.add("ln-sortable--drop-after");break}}},s.prototype._handlePointerEnd=function(o){if(!this._dragging)return;const l=this._dragging,r=Array.from(this.dom.children),a=r.indexOf(l);let c=null,u=null;for(const f of r){if(f.classList.contains("ln-sortable--drop-before")){c=f,u="before";break}if(f.classList.contains("ln-sortable--drop-after")){c=f,u="after";break}}for(const f of r)f.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");if(l.classList.remove("ln-sortable--dragging"),l.removeAttribute("aria-grabbed"),this.dom.classList.remove("ln-sortable--active"),c&&c!==l){u==="before"?this.dom.insertBefore(l,c):this.dom.insertBefore(l,c.nextElementSibling);const h=Array.from(this.dom.children).indexOf(l);C(this.dom,"ln-sortable:reordered",{item:l,oldIndex:a,newIndex:h})}this._dragging=null};function d(o){const l=o[t];if(!l)return;const r=o.getAttribute(e)!=="disabled";r!==l.isEnabled&&(l.isEnabled=r,C(o,r?"ln-sortable:enabled":"ln-sortable:disabled",{target:o}))}oe(e,t,s,"ln-sortable",{attributes:i})})()})();
@@ -1,36 +1,36 @@
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-sortable",
4
- "generator": "scripts/sync-ln-schemas.mjs",
5
- "attributes": {
6
- "data-ln-debug": {
7
- "direction": null,
8
- "sources": [
9
- "ln-sortable-dev.scss"
10
- ]
11
- },
12
- "data-ln-sortable": {
13
- "direction": "author",
14
- "sources": [
15
- "ln-sortable-dev.scss",
16
- "src/ln-sortable.js"
17
- ],
18
- "type": "enum",
19
- "values": [
20
- "enabled",
21
- "disabled"
22
- ],
23
- "fallback": "enabled",
24
- "description": "Enables drag-and-drop item reordering or disables when set to disabled"
25
- },
26
- "data-ln-sortable-handle": {
27
- "direction": "author",
28
- "sources": [
29
- "ln-sortable-dev.scss",
30
- "src/ln-sortable.js"
31
- ],
32
- "type": "marker",
33
- "description": "Designates an element as the drag handle for its parent sortable item"
34
- }
35
- }
36
- }
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-sortable",
4
+ "generator": "scripts/sync-ln-schemas.mjs",
5
+ "attributes": {
6
+ "data-ln-debug": {
7
+ "direction": null,
8
+ "sources": [
9
+ "ln-sortable-dev.scss"
10
+ ]
11
+ },
12
+ "data-ln-sortable": {
13
+ "direction": "author",
14
+ "sources": [
15
+ "ln-sortable-dev.scss",
16
+ "src/ln-sortable.js"
17
+ ],
18
+ "type": "enum",
19
+ "values": [
20
+ "enabled",
21
+ "disabled"
22
+ ],
23
+ "fallback": "enabled",
24
+ "description": "Enables drag-and-drop item reordering or disables when set to disabled"
25
+ },
26
+ "data-ln-sortable-handle": {
27
+ "direction": "author",
28
+ "sources": [
29
+ "ln-sortable-dev.scss",
30
+ "src/ln-sortable.js"
31
+ ],
32
+ "type": "marker",
33
+ "description": "Designates an element as the drag handle for its parent sortable item"
34
+ }
35
+ }
36
+ }
@@ -1,8 +1,8 @@
1
- @use '../../theme/config/mixins' as *;
2
-
3
- [data-ln-debug] {
4
- // 1. Metric Store Name Check: data-ln-stat cannot have an empty store name
5
- [data-ln-stat=""] {
6
- @include dev-inline-error("data-ln-stat store name cannot be empty");
7
- }
8
- }
1
+ @use '../../theme/config/mixins' as *;
2
+
3
+ [data-ln-debug] {
4
+ // 1. Metric Store Name Check: data-ln-stat cannot have an empty store name
5
+ [data-ln-stat=""] {
6
+ @include dev-inline-error("data-ln-stat store name cannot be empty");
7
+ }
8
+ }
@@ -1 +1 @@
1
- (function(){"use strict";function L(){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 C(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(!C(r))return}e.apply(console,t)}}function E(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 h(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){h(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const $={};function j(e,t){$[e]=t}function W(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=j,window.lnCore.getDataMapper=W);function V(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,h(function(){new MutationObserver(function(){E(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const T={};function H(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];T[n]=t}function U(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=H,window.lnCore.getLocaleFallback=U,window.lnCore.ensureLocaleObserver=V);const y={};function J(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=y[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function D(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],s=c.getAttribute("data-ln-field");t[s]!=null&&(c.textContent=t[s])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const c=r[l],s=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<s.length;u++){const d=s[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(a,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const c=o[l],s=c.getAttribute("data-ln-show");s in t&&c.classList.toggle("hidden",!t[s])}const i=e.querySelectorAll("[data-ln-class]");for(let l=0;l<i.length;l++){const c=i[l],s=c.getAttribute("data-ln-class").split(",");for(let u=0;u<s.length;u++){const d=s[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(a,!!t[f])}}return e}function Q(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)D(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 I(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,c){return t[c]!==void 0?t[c]:""}))}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],c=l.attributes;for(let s=0;s<c.length;s++){const u=c[s];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function K(e,t,n,r,o,i){const l={};for(let s=0;s<e.children.length;s++){const u=e.children[s],d=u.getAttribute("data-ln-render-key");d&&(l[d]=u)}const c=document.createDocumentFragment();for(let s=0;s<t.length;s++){const u=t[s],d=String(r(u));let a=l[d];if(a)o(a,u,s);else{const f=J(n,i);if(!f||(I(f,u),a=f.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",d),o(a,u,s)}c.appendChild(a)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=I,window.lnCore.fill=D,window.lnCore.lnFill=Q,window.lnCore.renderList=K);function g(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function P(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function G(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 X(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const m=new Map;function z(e,t){const n=(e?e.join("|"):"")+"::"+t;if(m.has(n))return m.get(n);const r=new Set(e||[]),o=function(i,l){const c=i.getAttribute(l);return c!==null&&r.has(c)?c:t};return m.set(n,o),o}function Y(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function Z(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function R(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 c=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"?(c(`[${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:(c(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${s.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const s=parseInt(t,10);return e.min!==void 0&&s<e.min?(c(`[${i}] Value ${s} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&s>e.max?(c(`[${i}] Value ${s} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(s){return c(`[${i}] Invalid JSON for attribute "${n}": ${s.message}. Fallback: ${e.fallback}.`),!1}return!0}function ee(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 te(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=P;break;case"float":o=Y;break;case"boolean":o=G;break;case"list":o=X;break;case"json":o=Z;break;case"string":default:o=g;break}o||(o=g),t[r.prop]=[o,n,r.fallback]}return t}function ne(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 re(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 A(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 c of l)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(s){console.error("["+n+"] init failed",c,s)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function oe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ie(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 N(){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 le(e){const t=N(),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=re(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 q(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 se(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=N(),o=r.byAttr.get(n);if(L()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&C(t)){const i=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let c=0;c<i.length;c++)R(i[c].spec,l,n,i[c].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&&q(i,t,n,e.oldValue),r.reactiveWildcard.length&&q(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):(A(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,h(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{se(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 F(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ue(e){const t=F();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];A(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,c=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&c.push(r);for(let s=0;s<c.length;s++){const u=c[s];if(!document.contains(u)){const d=u[i.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(a){console.error("["+i.attribute+"] destroy failed",u,a)}delete u[i.attribute]}}}}}}function ae(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,h(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ue(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function de(e,t,n,r,o={}){const i=o.extraAttributes||[],l=o.onAttributeChange||null,c=o.onSubtreeChange||null,s=o.onInit||null,u=o.onAttrChange||null,d=o.effects||null,a=o.attributes||null,f=a?ne(a):d,_e=a?new Set(Object.keys(a)):null,Se=o.persist||null;function p(v){const w=v||document.body;if(A(w,e,t,n),a&&L())for(const b in a){const ke=a[b],k=Array.from(w.querySelectorAll("["+b+"]"));w.matches&&w.matches("["+b+"]")&&k.push(w);for(let O=0;O<k.length;O++){const x=k[O];C(x)&&R(ke,x.getAttribute(b),b,r,x)}}s&&s(w)}const S=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let w;for(;(w=v.exec(e))!==null;)S.push(w[1])}else S.push(e);le({selector:e,attribute:t,componentTag:r,attributes:a,ComponentFn:n,onInit:s,observed:S.concat(i),onAttributeChange:l,onAttrChange:u,effects:f,declared:_e,persist:Se}),ce();const ve=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";F().push({selector:e,attribute:t,ComponentFn:n,onInit:s,onSubtreeChange:c,query:ve}),ae(),window[t]=p;function B(){oe()>0?ie(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",B):B(),p}function M(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,n={},r=M(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 c=l.indexOf(":"),s=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(s)try{n[s]=decodeURIComponent(u)}catch{n[s]=u}}return n}function fe(e){if(!e)return null;const t=_();return e in t?t[e]:null}function we(e,t){if(!e)return;const n=_();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("&");M(location.hash)!==o&&(location.hash=o)}function be(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function he(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 ge(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function pe(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 Ce(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ye(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=_,window.lnCore.hashGet=fe,window.lnCore.hashSet=we,window.lnCore.hashLinkClick=be,window.lnCore.resolveHashNamespace=he,window.lnCore.hashSortEncode=ge,window.lnCore.hashSortDecode=pe,window.lnCore.hashFilterEncode=Ce,window.lnCore.hashFilterDecode=ye);function me(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t).trim(),r=e.slice(t+1).trim();if(!n)return null;const o={};return o[n]=[r],o}function Ae(e){return e==null?"":String(e)}(function(){const e="data-ln-stat",t="lnStat";if(window[t]!==void 0)return;const n={"data-ln-stat":{prop:"_storeName",type:"string",read:g,fallback:"",description:"Store or entity name to count"},"data-ln-stat-filter":{prop:"_filterRaw",type:"string",read:g,fallback:"",description:"JSON or key:value filter criteria for record counting"}},r=te(n);function o(i){return this.dom=i,ee(this,i,r),this._onSetCount=function(l){i.textContent=Ae(l.detail&&l.detail.count),i.classList.remove("is-loading")},i.addEventListener("ln-stat:set-count",this._onSetCount),E(i,"ln-stat:request-count",{stat:this._storeName,filters:me(this._filterRaw)}),this}o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-stat:set-count",this._onSetCount),delete this.dom[t])},de(e,t,o,"ln-stat",{attributes:n})})()})();
1
+ (function(){"use strict";function L(){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 C(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(!C(r))return}e.apply(console,t)}}function E(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 h(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){h(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const $={};function j(e,t){$[e]=t}function W(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=j,window.lnCore.getDataMapper=W);function V(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,h(function(){new MutationObserver(function(){E(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const D={};function U(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];D[n]=t}function H(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return D[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=U,window.lnCore.getLocaleFallback=H,window.lnCore.ensureLocaleObserver=V);const y={};function J(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=y[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 c=n[l],s=c.getAttribute("data-ln-field");t[s]!=null&&(c.textContent=t[s])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const c=r[l],s=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<s.length;u++){const d=s[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(a,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const c=o[l],s=c.getAttribute("data-ln-show");s in t&&c.classList.toggle("hidden",!t[s])}const i=e.querySelectorAll("[data-ln-class]");for(let l=0;l<i.length;l++){const c=i[l],s=c.getAttribute("data-ln-class").split(",");for(let u=0;u<s.length;u++){const d=s[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(a,!!t[f])}}return e}function Q(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 T(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,c){return t[c]!==void 0?t[c]:""}))}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],c=l.attributes;for(let s=0;s<c.length;s++){const u=c[s];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function K(e,t,n,r,o,i){const l={};for(let s=0;s<e.children.length;s++){const u=e.children[s],d=u.getAttribute("data-ln-render-key");d&&(l[d]=u)}const c=document.createDocumentFragment();for(let s=0;s<t.length;s++){const u=t[s],d=String(r(u));let a=l[d];if(a)o(a,u,s);else{const f=J(n,i);if(!f||(T(f,u),a=f.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",d),o(a,u,s)}c.appendChild(a)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=T,window.lnCore.fill=I,window.lnCore.lnFill=Q,window.lnCore.renderList=K);function p(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function P(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function G(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 X(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const m=new Map;function z(e,t){const n=(e?e.join("|"):"")+"::"+t;if(m.has(n))return m.get(n);const r=new Set(e||[]),o=function(i,l){const c=i.getAttribute(l);return c!==null&&r.has(c)?c:t};return m.set(n,o),o}function Y(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function Z(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function R(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 c=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"?(c(`[${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:(c(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${s.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const s=parseInt(t,10);return e.min!==void 0&&s<e.min?(c(`[${i}] Value ${s} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&s>e.max?(c(`[${i}] Value ${s} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(s){return c(`[${i}] Invalid JSON for attribute "${n}": ${s.message}. Fallback: ${e.fallback}.`),!1}return!0}function ee(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 te(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=P;break;case"float":o=Y;break;case"boolean":o=G;break;case"list":o=X;break;case"json":o=Z;break;case"string":default:o=p;break}o||(o=p),t[r.prop]=[o,n,r.fallback]}return t}function ne(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 re(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 A(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 c of l)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(s){console.error("["+n+"] init failed",c,s)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function oe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ie(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 N(){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 le(e){const t=N(),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=re(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 q(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 se(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=N(),o=r.byAttr.get(n);if(L()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&C(t)){const i=r.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let c=0;c<i.length;c++)R(i[c].spec,l,n,i[c].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&&q(i,t,n,e.oldValue),r.reactiveWildcard.length&&q(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):(A(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,h(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{se(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 F(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ue(e){const t=F();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];A(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,c=Array.from(r.querySelectorAll(l));r.matches&&r.matches(l)&&c.push(r);for(let s=0;s<c.length;s++){const u=c[s];if(!document.contains(u)){const d=u[i.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(a){console.error("["+i.attribute+"] destroy failed",u,a)}delete u[i.attribute]}}}}}}function ae(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,h(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ue(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function de(e,t,n,r,o={}){const i=o.extraAttributes||[],l=o.onAttributeChange||null,c=o.onSubtreeChange||null,s=o.onInit||null,u=o.onAttrChange||null,d=o.effects||null,a=o.attributes||null,f=a?ne(a):d,_e=a?new Set(Object.keys(a)):null,Se=o.persist||null;function g(S){const w=S||document.body;if(A(w,e,t,n),a&&L())for(const b in a){const ke=a[b],v=Array.from(w.querySelectorAll("["+b+"]"));w.matches&&w.matches("["+b+"]")&&v.push(w);for(let k=0;k<v.length;k++){const O=v[k];C(O)&&R(ke,O.getAttribute(b),b,r,O)}}s&&s(w)}const _=[];if(e.indexOf("[")!==-1){const S=/\[([\w-]+)/g;let w;for(;(w=S.exec(e))!==null;)_.push(w[1])}else _.push(e);le({selector:e,attribute:t,componentTag:r,attributes:a,ComponentFn:n,onInit:s,observed:_.concat(i),onAttributeChange:l,onAttrChange:u,effects:f,declared:_e,persist:Se}),ce();const ve=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";F().push({selector:e,attribute:t,ComponentFn:n,onInit:s,onSubtreeChange:c,query:ve}),ae(),window[t]=g;function B(){oe()>0?ie(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",B):B(),g}function M(e){return(e||"").replace(/^#/,"")}function x(e){const t=e===void 0?location.hash:e,n={},r=M(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 c=l.indexOf(":"),s=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(s)try{n[s]=decodeURIComponent(u)}catch{n[s]=u}}return n}function fe(e){if(!e)return null;const t=x();return e in t?t[e]:null}function we(e,t){if(!e)return;const n=x();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("&");M(location.hash)!==o&&(location.hash=o)}function be(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function he(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 pe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ge(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 Ce(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ye(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=x,window.lnCore.hashGet=fe,window.lnCore.hashSet=we,window.lnCore.hashLinkClick=be,window.lnCore.resolveHashNamespace=he,window.lnCore.hashSortEncode=pe,window.lnCore.hashSortDecode=ge,window.lnCore.hashFilterEncode=Ce,window.lnCore.hashFilterDecode=ye);function me(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=me);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).trim(),r=e.slice(t+1).trim();if(!n)return null;const o={};return o[n]=[r],o}function xe(e){return e==null?"":String(e)}(function(){const e="data-ln-stat",t="lnStat";if(window[t]!==void 0)return;const n={"data-ln-stat":{prop:"_storeName",type:"string",read:p,fallback:"",description:"Store or entity name to count"},"data-ln-stat-filter":{prop:"_filterRaw",type:"string",read:p,fallback:"",description:"JSON or key:value filter criteria for record counting"}},r=te(n);function o(i){return this.dom=i,ee(this,i,r),this._onSetCount=function(l){i.textContent=xe(l.detail&&l.detail.count),i.classList.remove("is-loading")},i.addEventListener("ln-stat:set-count",this._onSetCount),E(i,"ln-stat:request-count",{stat:this._storeName,filters:Ae(this._filterRaw)}),this}o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-stat:set-count",this._onSetCount),delete this.dom[t])},de(e,t,o,"ln-stat",{attributes:n})})()})();
@@ -1,32 +1,32 @@
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-stat",
4
- "generator": "scripts/sync-ln-schemas.mjs",
5
- "attributes": {
6
- "data-ln-debug": {
7
- "direction": null,
8
- "sources": [
9
- "ln-stat-dev.scss"
10
- ]
11
- },
12
- "data-ln-stat": {
13
- "direction": null,
14
- "sources": [
15
- "ln-stat-dev.scss",
16
- "src/ln-stat.js"
17
- ],
18
- "type": "string",
19
- "fallback": "",
20
- "description": "Store or entity name to count"
21
- },
22
- "data-ln-stat-filter": {
23
- "direction": null,
24
- "sources": [
25
- "src/ln-stat.js"
26
- ],
27
- "type": "string",
28
- "fallback": "",
29
- "description": "JSON or key:value filter criteria for record counting"
30
- }
31
- }
32
- }
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-stat",
4
+ "generator": "scripts/sync-ln-schemas.mjs",
5
+ "attributes": {
6
+ "data-ln-debug": {
7
+ "direction": null,
8
+ "sources": [
9
+ "ln-stat-dev.scss"
10
+ ]
11
+ },
12
+ "data-ln-stat": {
13
+ "direction": null,
14
+ "sources": [
15
+ "ln-stat-dev.scss",
16
+ "src/ln-stat.js"
17
+ ],
18
+ "type": "string",
19
+ "fallback": "",
20
+ "description": "Store or entity name to count"
21
+ },
22
+ "data-ln-stat-filter": {
23
+ "direction": null,
24
+ "sources": [
25
+ "src/ln-stat.js"
26
+ ],
27
+ "type": "string",
28
+ "fallback": "",
29
+ "description": "JSON or key:value filter criteria for record counting"
30
+ }
31
+ }
32
+ }