@genesislcap/foundation-utils 14.333.1-alpha-9833070.0 → 14.333.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -185,29 +185,6 @@
185
185
  }
186
186
  ]
187
187
  },
188
- {
189
- "kind": "javascript-module",
190
- "path": "src/directives/index.ts",
191
- "declarations": [],
192
- "exports": [
193
- {
194
- "kind": "js",
195
- "name": "*",
196
- "declaration": {
197
- "name": "*",
198
- "package": "./sync"
199
- }
200
- },
201
- {
202
- "kind": "js",
203
- "name": "*",
204
- "declaration": {
205
- "name": "*",
206
- "package": "./when-else"
207
- }
208
- }
209
- ]
210
- },
211
188
  {
212
189
  "kind": "javascript-module",
213
190
  "path": "src/data/inMemoryDatabase.ts",
@@ -406,6 +383,82 @@
406
383
  }
407
384
  ]
408
385
  },
386
+ {
387
+ "kind": "javascript-module",
388
+ "path": "src/decorators/index.ts",
389
+ "declarations": [],
390
+ "exports": [
391
+ {
392
+ "kind": "js",
393
+ "name": "*",
394
+ "declaration": {
395
+ "name": "*",
396
+ "package": "./renderOnChange"
397
+ }
398
+ }
399
+ ]
400
+ },
401
+ {
402
+ "kind": "javascript-module",
403
+ "path": "src/decorators/renderOnChange.ts",
404
+ "declarations": [
405
+ {
406
+ "kind": "function",
407
+ "name": "renderOnChange",
408
+ "parameters": [
409
+ {
410
+ "name": "target",
411
+ "type": {
412
+ "text": "FASTElement & { render(): void }"
413
+ },
414
+ "description": "The target to define the property change handler on."
415
+ },
416
+ {
417
+ "name": "name",
418
+ "type": {
419
+ "text": "string"
420
+ },
421
+ "description": "The property name."
422
+ }
423
+ ],
424
+ "description": "Defines a property changed handler that calls a render() method on the target as an internal observation enhancement.",
425
+ "privacy": "public"
426
+ }
427
+ ],
428
+ "exports": [
429
+ {
430
+ "kind": "js",
431
+ "name": "renderOnChange",
432
+ "declaration": {
433
+ "name": "renderOnChange",
434
+ "module": "src/decorators/renderOnChange.ts"
435
+ }
436
+ }
437
+ ]
438
+ },
439
+ {
440
+ "kind": "javascript-module",
441
+ "path": "src/directives/index.ts",
442
+ "declarations": [],
443
+ "exports": [
444
+ {
445
+ "kind": "js",
446
+ "name": "*",
447
+ "declaration": {
448
+ "name": "*",
449
+ "package": "./sync"
450
+ }
451
+ },
452
+ {
453
+ "kind": "js",
454
+ "name": "*",
455
+ "declaration": {
456
+ "name": "*",
457
+ "package": "./when-else"
458
+ }
459
+ }
460
+ ]
461
+ },
409
462
  {
410
463
  "kind": "javascript-module",
411
464
  "path": "src/encoding/index.ts",
@@ -896,6 +949,126 @@
896
949
  }
897
950
  ]
898
951
  },
952
+ {
953
+ "kind": "javascript-module",
954
+ "path": "src/design-system/design-system.ts",
955
+ "declarations": [
956
+ {
957
+ "kind": "function",
958
+ "name": "assureDesignSystem",
959
+ "return": {
960
+ "type": {
961
+ "text": "DesignSystemModule"
962
+ }
963
+ },
964
+ "parameters": [
965
+ {
966
+ "name": "module",
967
+ "type": {
968
+ "text": "DesignSystemModule"
969
+ }
970
+ }
971
+ ],
972
+ "description": "assureDesignSystem.",
973
+ "privacy": "public"
974
+ },
975
+ {
976
+ "kind": "function",
977
+ "name": "getCurrentDesignSystem",
978
+ "return": {
979
+ "type": {
980
+ "text": ""
981
+ }
982
+ },
983
+ "parameters": [
984
+ {
985
+ "name": "element",
986
+ "type": {
987
+ "text": "HTMLElement"
988
+ },
989
+ "description": "The starting HTML element"
990
+ },
991
+ {
992
+ "name": "fallbackPrefix",
993
+ "type": {
994
+ "text": "string"
995
+ },
996
+ "description": "The prefix to fallback to if the provider is not available"
997
+ }
998
+ ],
999
+ "description": "Get the current design system provider element and prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
1000
+ "privacy": "public"
1001
+ },
1002
+ {
1003
+ "kind": "function",
1004
+ "name": "getCurrentDesignSystemPrefix",
1005
+ "return": {
1006
+ "type": {
1007
+ "text": ""
1008
+ }
1009
+ },
1010
+ "parameters": [
1011
+ {
1012
+ "name": "element",
1013
+ "type": {
1014
+ "text": "HTMLElement"
1015
+ },
1016
+ "description": "The starting HTML element"
1017
+ },
1018
+ {
1019
+ "name": "fallbackPrefix",
1020
+ "type": {
1021
+ "text": "string"
1022
+ },
1023
+ "description": "The prefix to fallback to if the provider is not available"
1024
+ }
1025
+ ],
1026
+ "description": "Get the current design system prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
1027
+ "privacy": "public"
1028
+ }
1029
+ ],
1030
+ "exports": [
1031
+ {
1032
+ "kind": "js",
1033
+ "name": "assureDesignSystem",
1034
+ "declaration": {
1035
+ "name": "assureDesignSystem",
1036
+ "module": "src/design-system/design-system.ts"
1037
+ }
1038
+ },
1039
+ {
1040
+ "kind": "js",
1041
+ "name": "getCurrentDesignSystem",
1042
+ "declaration": {
1043
+ "name": "getCurrentDesignSystem",
1044
+ "module": "src/design-system/design-system.ts"
1045
+ }
1046
+ },
1047
+ {
1048
+ "kind": "js",
1049
+ "name": "getCurrentDesignSystemPrefix",
1050
+ "declaration": {
1051
+ "name": "getCurrentDesignSystemPrefix",
1052
+ "module": "src/design-system/design-system.ts"
1053
+ }
1054
+ }
1055
+ ]
1056
+ },
1057
+ {
1058
+ "kind": "javascript-module",
1059
+ "path": "src/design-system/index.ts",
1060
+ "declarations": [],
1061
+ "exports": [
1062
+ {
1063
+ "kind": "js",
1064
+ "name": "*",
1065
+ "declaration": {
1066
+ "name": "*",
1067
+ "package": "./design-system"
1068
+ }
1069
+ }
1070
+ ]
1071
+ },
899
1072
  {
900
1073
  "kind": "javascript-module",
901
1074
  "path": "src/error/errorMap.ts",
@@ -1095,179 +1268,6 @@
1095
1268
  }
1096
1269
  ]
1097
1270
  },
1098
- {
1099
- "kind": "javascript-module",
1100
- "path": "src/design-system/design-system.ts",
1101
- "declarations": [
1102
- {
1103
- "kind": "function",
1104
- "name": "assureDesignSystem",
1105
- "return": {
1106
- "type": {
1107
- "text": "DesignSystemModule"
1108
- }
1109
- },
1110
- "parameters": [
1111
- {
1112
- "name": "module",
1113
- "type": {
1114
- "text": "DesignSystemModule"
1115
- }
1116
- }
1117
- ],
1118
- "description": "assureDesignSystem.",
1119
- "privacy": "public"
1120
- },
1121
- {
1122
- "kind": "function",
1123
- "name": "getCurrentDesignSystem",
1124
- "return": {
1125
- "type": {
1126
- "text": ""
1127
- }
1128
- },
1129
- "parameters": [
1130
- {
1131
- "name": "element",
1132
- "type": {
1133
- "text": "HTMLElement"
1134
- },
1135
- "description": "The starting HTML element"
1136
- },
1137
- {
1138
- "name": "fallbackPrefix",
1139
- "type": {
1140
- "text": "string"
1141
- },
1142
- "description": "The prefix to fallback to if the provider is not available"
1143
- }
1144
- ],
1145
- "description": "Get the current design system provider element and prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
1146
- "privacy": "public"
1147
- },
1148
- {
1149
- "kind": "function",
1150
- "name": "getCurrentDesignSystemPrefix",
1151
- "return": {
1152
- "type": {
1153
- "text": ""
1154
- }
1155
- },
1156
- "parameters": [
1157
- {
1158
- "name": "element",
1159
- "type": {
1160
- "text": "HTMLElement"
1161
- },
1162
- "description": "The starting HTML element"
1163
- },
1164
- {
1165
- "name": "fallbackPrefix",
1166
- "type": {
1167
- "text": "string"
1168
- },
1169
- "description": "The prefix to fallback to if the provider is not available"
1170
- }
1171
- ],
1172
- "description": "Get the current design system prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
1173
- "privacy": "public"
1174
- }
1175
- ],
1176
- "exports": [
1177
- {
1178
- "kind": "js",
1179
- "name": "assureDesignSystem",
1180
- "declaration": {
1181
- "name": "assureDesignSystem",
1182
- "module": "src/design-system/design-system.ts"
1183
- }
1184
- },
1185
- {
1186
- "kind": "js",
1187
- "name": "getCurrentDesignSystem",
1188
- "declaration": {
1189
- "name": "getCurrentDesignSystem",
1190
- "module": "src/design-system/design-system.ts"
1191
- }
1192
- },
1193
- {
1194
- "kind": "js",
1195
- "name": "getCurrentDesignSystemPrefix",
1196
- "declaration": {
1197
- "name": "getCurrentDesignSystemPrefix",
1198
- "module": "src/design-system/design-system.ts"
1199
- }
1200
- }
1201
- ]
1202
- },
1203
- {
1204
- "kind": "javascript-module",
1205
- "path": "src/design-system/index.ts",
1206
- "declarations": [],
1207
- "exports": [
1208
- {
1209
- "kind": "js",
1210
- "name": "*",
1211
- "declaration": {
1212
- "name": "*",
1213
- "package": "./design-system"
1214
- }
1215
- }
1216
- ]
1217
- },
1218
- {
1219
- "kind": "javascript-module",
1220
- "path": "src/decorators/index.ts",
1221
- "declarations": [],
1222
- "exports": [
1223
- {
1224
- "kind": "js",
1225
- "name": "*",
1226
- "declaration": {
1227
- "name": "*",
1228
- "package": "./renderOnChange"
1229
- }
1230
- }
1231
- ]
1232
- },
1233
- {
1234
- "kind": "javascript-module",
1235
- "path": "src/decorators/renderOnChange.ts",
1236
- "declarations": [
1237
- {
1238
- "kind": "function",
1239
- "name": "renderOnChange",
1240
- "parameters": [
1241
- {
1242
- "name": "target",
1243
- "type": {
1244
- "text": "FASTElement & { render(): void }"
1245
- },
1246
- "description": "The target to define the property change handler on."
1247
- },
1248
- {
1249
- "name": "name",
1250
- "type": {
1251
- "text": "string"
1252
- },
1253
- "description": "The property name."
1254
- }
1255
- ],
1256
- "description": "Defines a property changed handler that calls a render() method on the target as an internal observation enhancement.",
1257
- "privacy": "public"
1258
- }
1259
- ],
1260
- "exports": [
1261
- {
1262
- "kind": "js",
1263
- "name": "renderOnChange",
1264
- "declaration": {
1265
- "name": "renderOnChange",
1266
- "module": "src/decorators/renderOnChange.ts"
1267
- }
1268
- }
1269
- ]
1270
- },
1271
1271
  {
1272
1272
  "kind": "javascript-module",
1273
1273
  "path": "src/formatters/datetime.ts",
@@ -1 +1 @@
1
- {"version":3,"file":"design-system.d.ts","sourceRoot":"","sources":["../../../src/design-system/design-system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,mBAAmB,CACjB,OAAO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,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,CAQjF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,WAAW,EACpB,cAAc,EAAE,MAAM,GACrB;IAAE,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAiDjD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAEjG"}
@@ -62,6 +62,7 @@ export function assureDesignSystem(module) {
62
62
  * @public
63
63
  */
64
64
  export function getCurrentDesignSystem(element, fallbackPrefix) {
65
+ // First try: Check element and its ancestors
65
66
  let current = element;
66
67
  while (current) {
67
68
  const tagName = current.tagName.toLowerCase();
@@ -72,6 +73,7 @@ export function getCurrentDesignSystem(element, fallbackPrefix) {
72
73
  return { element: current, prefix };
73
74
  }
74
75
  }
76
+ // Move up the DOM tree, handling shadow DOM boundaries
75
77
  if (current.parentElement) {
76
78
  current = current.parentElement;
77
79
  }
@@ -82,8 +84,10 @@ export function getCurrentDesignSystem(element, fallbackPrefix) {
82
84
  current = null;
83
85
  }
84
86
  }
87
+ // Second try: Document-wide search
85
88
  const allProviders = document.querySelectorAll('[class*="-design-system-provider"],[id*="-design-system-provider"]');
86
89
  const providerElements = Array.from(allProviders);
90
+ // Add shadow DOM providers
87
91
  const shadowProviders = getAllElements(document).filter((el) => {
88
92
  var _a;
89
93
  const tagName = (_a = el.tagName) === null || _a === void 0 ? void 0 : _a.toLowerCase();
@@ -91,17 +95,6 @@ export function getCurrentDesignSystem(element, fallbackPrefix) {
91
95
  });
92
96
  providerElements.push(...shadowProviders);
93
97
  if (providerElements.length > 0) {
94
- const preferredProvider = providerElements.find((provider) => {
95
- const providerTag = provider.tagName.toLowerCase();
96
- const prefix = providerTag.split('-design-system-provider')[0];
97
- return prefix === fallbackPrefix;
98
- });
99
- if (preferredProvider && preferredProvider.tagName) {
100
- const providerTag = preferredProvider.tagName.toLowerCase();
101
- const prefix = providerTag.split('-design-system-provider')[0];
102
- logger.debug(`Found preferred provider: ${providerTag}, prefix: ${prefix}`);
103
- return { element: preferredProvider, prefix };
104
- }
105
98
  const provider = providerElements[0];
106
99
  const providerTag = provider.tagName.toLowerCase();
107
100
  const prefix = providerTag.split('-design-system-provider')[0];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-utils",
3
3
  "description": "Genesis Foundation Utils",
4
- "version": "14.333.1-alpha-9833070.0",
4
+ "version": "14.333.1",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -27,18 +27,18 @@
27
27
  }
28
28
  },
29
29
  "devDependencies": {
30
- "@genesislcap/foundation-testing": "14.333.1-alpha-9833070.0",
31
- "@genesislcap/genx": "14.333.1-alpha-9833070.0",
32
- "@genesislcap/rollup-builder": "14.333.1-alpha-9833070.0",
33
- "@genesislcap/ts-builder": "14.333.1-alpha-9833070.0",
34
- "@genesislcap/uvu-playwright-builder": "14.333.1-alpha-9833070.0",
35
- "@genesislcap/vite-builder": "14.333.1-alpha-9833070.0",
36
- "@genesislcap/webpack-builder": "14.333.1-alpha-9833070.0",
30
+ "@genesislcap/foundation-testing": "14.333.1",
31
+ "@genesislcap/genx": "14.333.1",
32
+ "@genesislcap/rollup-builder": "14.333.1",
33
+ "@genesislcap/ts-builder": "14.333.1",
34
+ "@genesislcap/uvu-playwright-builder": "14.333.1",
35
+ "@genesislcap/vite-builder": "14.333.1",
36
+ "@genesislcap/webpack-builder": "14.333.1",
37
37
  "@types/json-schema": "^7.0.11"
38
38
  },
39
39
  "dependencies": {
40
- "@genesislcap/expression-builder": "14.333.1-alpha-9833070.0",
41
- "@genesislcap/foundation-logger": "14.333.1-alpha-9833070.0",
40
+ "@genesislcap/expression-builder": "14.333.1",
41
+ "@genesislcap/foundation-logger": "14.333.1",
42
42
  "@microsoft/fast-components": "2.30.6",
43
43
  "@microsoft/fast-element": "1.14.0",
44
44
  "@microsoft/fast-foundation": "2.49.6",
@@ -56,5 +56,5 @@
56
56
  "access": "public"
57
57
  },
58
58
  "customElements": "dist/custom-elements.json",
59
- "gitHead": "959d9463a5616874018520a020d5ee95955ddffd"
59
+ "gitHead": "296b9fe75195b9f73a6b1210b69955a975220e06"
60
60
  }