@vertz/ui 0.2.23 → 0.2.24

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.
@@ -5,6 +5,9 @@ import {
5
5
  getAdapter,
6
6
  isRenderNode
7
7
  } from "./chunk-2y9f9j62.js";
8
+ import {
9
+ registerActiveQuery
10
+ } from "./chunk-2eh4p2n7.js";
8
11
  import {
9
12
  isBrowser
10
13
  } from "./chunk-da2w7j7w.js";
@@ -107,30 +110,6 @@ class MemoryCache {
107
110
  }
108
111
  }
109
112
 
110
- // src/query/invalidate.ts
111
- var registry = new Set;
112
- function registerActiveQuery(entityMeta, refetch) {
113
- const registration = { entityMeta, refetch };
114
- registry.add(registration);
115
- return () => registry.delete(registration);
116
- }
117
- function invalidate(descriptor) {
118
- const meta = descriptor._entity;
119
- if (!meta)
120
- return;
121
- if (meta.kind === "get" && !meta.id)
122
- return;
123
- for (const reg of [...registry]) {
124
- if (reg.entityMeta.entityType !== meta.entityType)
125
- continue;
126
- if (reg.entityMeta.kind !== meta.kind)
127
- continue;
128
- if (meta.kind === "get" && reg.entityMeta.id !== meta.id)
129
- continue;
130
- reg.refetch();
131
- }
132
- }
133
-
134
113
  // src/query/key-derivation.ts
135
114
  function deriveKey(thunk) {
136
115
  return `__q:${hashString(thunk.toString())}`;
@@ -231,15 +210,15 @@ var INTERNAL_PROPS = new Set([
231
210
  ]);
232
211
 
233
212
  // src/store/relation-registry.ts
234
- var registry2 = new Map;
213
+ var registry = new Map;
235
214
  function registerRelationSchema(entityType, schema) {
236
- registry2.set(entityType, Object.freeze(schema));
215
+ registry.set(entityType, Object.freeze(schema));
237
216
  }
238
217
  function getRelationSchema(entityType) {
239
- return registry2.get(entityType);
218
+ return registry.get(entityType);
240
219
  }
241
220
  function resetRelationSchemas_TEST_ONLY() {
242
- registry2.clear();
221
+ registry.clear();
243
222
  }
244
223
 
245
224
  // src/store/merge.ts
@@ -700,6 +679,9 @@ class QueryEnvelopeStore {
700
679
  set(queryKey, envelope) {
701
680
  this._envelopes.set(queryKey, envelope);
702
681
  }
682
+ delete(queryKey) {
683
+ this._envelopes.delete(queryKey);
684
+ }
703
685
  clear() {
704
686
  this._envelopes.clear();
705
687
  }
@@ -874,11 +856,11 @@ function query(source, options = {}) {
874
856
  const {
875
857
  initialData,
876
858
  debounce: debounceMs,
877
- enabled = true,
878
859
  key: customKey,
879
860
  cache = getDefaultCache(),
880
- _entityMeta: entityMeta
861
+ _entityMeta: optionsEntityMeta
881
862
  } = options;
863
+ let entityMeta = optionsEntityMeta;
882
864
  const baseKey = deriveKey(thunk);
883
865
  const depHashSignal = signal("");
884
866
  const cacheKeyComputed = computed(() => {
@@ -910,9 +892,9 @@ function query(source, options = {}) {
910
892
  function callThunkWithCapture() {
911
893
  const captured = [];
912
894
  const prevCb = setReadValueCallback((v) => captured.push(v));
913
- let promise;
895
+ let result;
914
896
  try {
915
- promise = thunk();
897
+ result = thunk();
916
898
  } finally {
917
899
  setReadValueCallback(prevCb);
918
900
  }
@@ -920,12 +902,13 @@ function query(source, options = {}) {
920
902
  untrack(() => {
921
903
  depHashSignal.value = hashString(serialized);
922
904
  });
923
- return promise;
905
+ return result;
924
906
  }
925
907
  const rawData = signal(initialData);
926
- const loading = signal(initialData === undefined && enabled);
908
+ const loading = signal(initialData === undefined);
927
909
  const revalidating = signal(false);
928
910
  const error = signal(undefined);
911
+ const idle = signal(initialData === undefined);
929
912
  const entityBacked = signal(false);
930
913
  function normalizeToEntityStore(result) {
931
914
  if (!entityMeta)
@@ -951,30 +934,31 @@ function query(source, options = {}) {
951
934
  }
952
935
  }
953
936
  const referencedKeys = new Set;
954
- const data = entityMeta ? computed(() => {
937
+ const initialEntityMeta = entityMeta;
938
+ const data = initialEntityMeta ? computed(() => {
955
939
  if (!entityBacked.value)
956
940
  return rawData.value;
957
941
  const raw = rawData.value;
958
942
  const store = getEntityStore();
959
943
  const newKeys = new Set;
960
- if (entityMeta.kind === "get" && entityMeta.id) {
961
- const entity = store.get(entityMeta.entityType, entityMeta.id).value;
944
+ if (initialEntityMeta.kind === "get" && initialEntityMeta.id) {
945
+ const entity = store.get(initialEntityMeta.entityType, initialEntityMeta.id).value;
962
946
  if (!entity) {
963
947
  updateRefCounts(store, referencedKeys, newKeys);
964
948
  return;
965
949
  }
966
- const resolved = resolveReferences(entity, entityMeta.entityType, store, undefined, newKeys);
950
+ const resolved = resolveReferences(entity, initialEntityMeta.entityType, store, undefined, newKeys);
967
951
  updateRefCounts(store, referencedKeys, newKeys);
968
952
  return resolved;
969
953
  }
970
- const queryKey = customKey ?? entityMeta.entityType;
954
+ const queryKey = customKey ?? initialEntityMeta.entityType;
971
955
  const ids = store.queryIndices.get(queryKey);
972
956
  if (ids) {
973
957
  const items = ids.map((id) => {
974
- const entity = store.get(entityMeta.entityType, id).value;
958
+ const entity = store.get(initialEntityMeta.entityType, id).value;
975
959
  if (!entity)
976
960
  return null;
977
- return resolveReferences(entity, entityMeta.entityType, store, undefined, newKeys);
961
+ return resolveReferences(entity, initialEntityMeta.entityType, store, undefined, newKeys);
978
962
  }).filter((item) => item != null);
979
963
  const envelope = getQueryEnvelopeStore().get(queryKey);
980
964
  updateRefCounts(store, referencedKeys, newKeys);
@@ -989,37 +973,57 @@ function query(source, options = {}) {
989
973
  retainKey(initKey);
990
974
  }
991
975
  const ssrTimeout = options.ssrTimeout ?? getGlobalSSRTimeout() ?? 300;
992
- if (isSSR() && enabled && ssrTimeout !== 0 && initialData === undefined) {
993
- const promise = callThunkWithCapture();
994
- const key = untrack(() => getCacheKey());
995
- const cached = cache.get(key);
996
- if (cached !== undefined) {
997
- promise.catch(() => {});
998
- normalizeToEntityStore(cached);
999
- rawData.value = cached;
976
+ if (isSSR() && ssrTimeout !== 0 && initialData === undefined) {
977
+ const ssrRaw = callThunkWithCapture();
978
+ if (ssrRaw === null) {
1000
979
  loading.value = false;
1001
980
  } else {
1002
- promise.catch(() => {});
1003
- const ctx = getSSRContext();
1004
- if (ctx) {
1005
- ctx.queries.push({
1006
- promise,
1007
- timeout: ssrTimeout,
1008
- resolve: (result) => {
1009
- normalizeToEntityStore(result);
1010
- rawData.value = result;
1011
- loading.value = false;
1012
- cache.set(key, result);
1013
- },
1014
- key
981
+ let ssrPromise;
982
+ if (isQueryDescriptor(ssrRaw)) {
983
+ const fetchResult = ssrRaw._fetch();
984
+ ssrPromise = fetchResult.then((result) => {
985
+ if (!result.ok)
986
+ throw result.error;
987
+ return result.data;
1015
988
  });
989
+ if (ssrRaw._entity && !entityMeta) {
990
+ entityMeta = ssrRaw._entity;
991
+ }
992
+ } else {
993
+ ssrPromise = ssrRaw;
994
+ }
995
+ const key = untrack(() => getCacheKey());
996
+ const cached = cache.get(key);
997
+ if (cached !== undefined) {
998
+ ssrPromise.catch(() => {});
999
+ normalizeToEntityStore(cached);
1000
+ rawData.value = cached;
1001
+ loading.value = false;
1002
+ idle.value = false;
1003
+ } else {
1004
+ ssrPromise.catch(() => {});
1005
+ const ctx = getSSRContext();
1006
+ if (ctx) {
1007
+ ctx.queries.push({
1008
+ promise: ssrPromise,
1009
+ timeout: ssrTimeout,
1010
+ resolve: (result) => {
1011
+ normalizeToEntityStore(result);
1012
+ rawData.value = result;
1013
+ loading.value = false;
1014
+ idle.value = false;
1015
+ cache.set(key, result);
1016
+ },
1017
+ key
1018
+ });
1019
+ }
1016
1020
  }
1017
1021
  }
1018
1022
  }
1019
1023
  let ssrHydrationCleanup = null;
1020
1024
  let ssrHydrated = false;
1021
1025
  let navPrefetchDeferred = false;
1022
- if (!isSSR() && enabled && initialData === undefined) {
1026
+ if (!isSSR() && initialData === undefined) {
1023
1027
  const hydrationKey = customKey ?? baseKey;
1024
1028
  const isNavigation = isNavPrefetchActive();
1025
1029
  ssrHydrationCleanup = hydrateQueryFromSSR(hydrationKey, (result) => {
@@ -1086,7 +1090,7 @@ function query(source, options = {}) {
1086
1090
  }, ms);
1087
1091
  }
1088
1092
  let visibilityHandler;
1089
- if (hasInterval && enabled && isBrowser()) {
1093
+ if (hasInterval && isBrowser()) {
1090
1094
  visibilityHandler = () => {
1091
1095
  if (document.visibilityState === "hidden") {
1092
1096
  intervalPaused = true;
@@ -1149,116 +1153,154 @@ function query(source, options = {}) {
1149
1153
  refetchTrigger.value = refetchTrigger.peek() + 1;
1150
1154
  }
1151
1155
  let disposeFn;
1152
- if (enabled) {
1153
- let isFirst = true;
1154
- disposeFn = lifecycleEffect(() => {
1155
- refetchTrigger.value;
1156
- if (isFirst && ssrHydrated) {
1157
- isFirst = false;
1158
- return;
1159
- }
1160
- if (isFirst && navPrefetchDeferred) {
1161
- if (customKey) {
1162
- const cached = untrack(() => cache.get(customKey));
1163
- if (cached !== undefined) {
1164
- retainKey(customKey);
1165
- untrack(() => {
1166
- rawData.value = cached;
1167
- loading.value = false;
1168
- });
1169
- isFirst = false;
1170
- return;
1171
- }
1172
- } else {
1173
- const trackPromise = callThunkWithCapture();
1174
- trackPromise.catch(() => {});
1175
- const derivedKey = untrack(() => getCacheKey());
1176
- const cached = untrack(() => cache.get(derivedKey));
1177
- if (cached !== undefined) {
1178
- retainKey(derivedKey);
1179
- untrack(() => {
1180
- rawData.value = cached;
1181
- loading.value = false;
1182
- });
1183
- isFirst = false;
1184
- return;
1185
- }
1186
- }
1187
- isFirst = false;
1188
- return;
1189
- }
1156
+ let isFirst = true;
1157
+ disposeFn = lifecycleEffect(() => {
1158
+ refetchTrigger.value;
1159
+ if (isFirst && ssrHydrated) {
1160
+ isFirst = false;
1161
+ return;
1162
+ }
1163
+ if (isFirst && navPrefetchDeferred) {
1190
1164
  if (customKey) {
1191
- const existing = untrack(() => getInflight().get(customKey));
1192
- if (existing) {
1193
- const id = ++fetchId;
1165
+ const cached = untrack(() => cache.get(customKey));
1166
+ if (cached !== undefined) {
1167
+ retainKey(customKey);
1194
1168
  untrack(() => {
1195
- if (rawData.value !== undefined) {
1196
- revalidating.value = true;
1197
- } else {
1198
- loading.value = true;
1199
- }
1200
- error.value = undefined;
1169
+ rawData.value = cached;
1170
+ loading.value = false;
1201
1171
  });
1202
- handleFetchPromise(existing, id, customKey);
1203
1172
  isFirst = false;
1204
1173
  return;
1205
1174
  }
1206
- }
1207
- const promise = callThunkWithCapture();
1208
- const key = untrack(() => getCacheKey());
1209
- if (!customKey) {
1210
- const existing = untrack(() => getInflight().get(key));
1211
- if (existing) {
1212
- promise.catch(() => {});
1213
- const id = ++fetchId;
1214
- untrack(() => {
1215
- if (rawData.value !== undefined) {
1216
- revalidating.value = true;
1217
- } else {
1218
- loading.value = true;
1219
- }
1220
- error.value = undefined;
1221
- });
1222
- handleFetchPromise(existing, id, key);
1175
+ } else {
1176
+ const trackRaw = callThunkWithCapture();
1177
+ if (trackRaw === null) {
1223
1178
  isFirst = false;
1224
1179
  return;
1225
1180
  }
1226
- }
1227
- const isNavigation = ssrHydrationCleanup !== null;
1228
- const shouldCheckCache = isNavigation || (isFirst ? !!customKey : !customKey);
1229
- if (shouldCheckCache) {
1230
- const cached = untrack(() => cache.get(key));
1181
+ if (!isQueryDescriptor(trackRaw)) {
1182
+ trackRaw.catch(() => {});
1183
+ }
1184
+ const derivedKey = untrack(() => getCacheKey());
1185
+ const cached = untrack(() => cache.get(derivedKey));
1231
1186
  if (cached !== undefined) {
1232
- retainKey(key);
1233
- promise.catch(() => {});
1187
+ retainKey(derivedKey);
1234
1188
  untrack(() => {
1235
1189
  rawData.value = cached;
1236
1190
  loading.value = false;
1237
- error.value = undefined;
1238
1191
  });
1239
1192
  isFirst = false;
1240
- scheduleInterval();
1241
1193
  return;
1242
1194
  }
1243
1195
  }
1244
- if (isFirst && initialData !== undefined) {
1196
+ isFirst = false;
1197
+ return;
1198
+ }
1199
+ if (customKey) {
1200
+ const existing = untrack(() => getInflight().get(customKey));
1201
+ if (existing) {
1202
+ const id = ++fetchId;
1203
+ untrack(() => {
1204
+ if (rawData.value !== undefined) {
1205
+ revalidating.value = true;
1206
+ } else {
1207
+ loading.value = true;
1208
+ }
1209
+ error.value = undefined;
1210
+ });
1211
+ handleFetchPromise(existing, id, customKey);
1212
+ isFirst = false;
1213
+ return;
1214
+ }
1215
+ }
1216
+ const raw = callThunkWithCapture();
1217
+ if (raw === null) {
1218
+ clearTimeout(debounceTimer);
1219
+ untrack(() => {
1220
+ loading.value = false;
1221
+ });
1222
+ isFirst = false;
1223
+ return;
1224
+ }
1225
+ let promise;
1226
+ let effectKey;
1227
+ let effectEntityMeta;
1228
+ if (isQueryDescriptor(raw)) {
1229
+ effectKey = raw._key;
1230
+ effectEntityMeta = raw._entity;
1231
+ const fetchResult = raw._fetch();
1232
+ promise = fetchResult.then((result) => {
1233
+ if (!result.ok)
1234
+ throw result.error;
1235
+ return result.data;
1236
+ });
1237
+ if (effectEntityMeta && !entityMeta) {
1238
+ entityMeta = effectEntityMeta;
1239
+ if (!isSSR()) {
1240
+ unsubscribeBus = getMutationEventBus().subscribe(entityMeta.entityType, refetch);
1241
+ unregisterFromRegistry = registerActiveQuery(entityMeta, refetch, createClearData(entityMeta));
1242
+ }
1243
+ }
1244
+ } else {
1245
+ promise = raw;
1246
+ }
1247
+ untrack(() => {
1248
+ idle.value = false;
1249
+ });
1250
+ const key = effectKey ?? untrack(() => getCacheKey());
1251
+ if (!customKey && !effectKey) {
1252
+ const existing = untrack(() => getInflight().get(key));
1253
+ if (existing) {
1254
+ promise.catch(() => {});
1255
+ const id = ++fetchId;
1256
+ untrack(() => {
1257
+ if (rawData.value !== undefined) {
1258
+ revalidating.value = true;
1259
+ } else {
1260
+ loading.value = true;
1261
+ }
1262
+ error.value = undefined;
1263
+ });
1264
+ handleFetchPromise(existing, id, key);
1265
+ isFirst = false;
1266
+ return;
1267
+ }
1268
+ }
1269
+ const isNavigation = ssrHydrationCleanup !== null;
1270
+ const shouldCheckCache = effectKey || isNavigation || (isFirst ? !!customKey : !customKey);
1271
+ if (shouldCheckCache) {
1272
+ const cached = untrack(() => cache.get(key));
1273
+ if (cached !== undefined) {
1274
+ retainKey(key);
1245
1275
  promise.catch(() => {});
1276
+ untrack(() => {
1277
+ normalizeToEntityStore(cached);
1278
+ rawData.value = cached;
1279
+ loading.value = false;
1280
+ error.value = undefined;
1281
+ });
1246
1282
  isFirst = false;
1247
1283
  scheduleInterval();
1248
1284
  return;
1249
1285
  }
1286
+ }
1287
+ if (isFirst && initialData !== undefined) {
1288
+ promise.catch(() => {});
1250
1289
  isFirst = false;
1251
- if (debounceMs !== undefined && debounceMs > 0) {
1252
- clearTimeout(debounceTimer);
1253
- promise.catch(() => {});
1254
- debounceTimer = setTimeout(() => {
1255
- startFetch(promise, key);
1256
- }, debounceMs);
1257
- } else {
1290
+ scheduleInterval();
1291
+ return;
1292
+ }
1293
+ isFirst = false;
1294
+ if (debounceMs !== undefined && debounceMs > 0) {
1295
+ clearTimeout(debounceTimer);
1296
+ promise.catch(() => {});
1297
+ debounceTimer = setTimeout(() => {
1258
1298
  startFetch(promise, key);
1259
- }
1260
- });
1261
- }
1299
+ }, debounceMs);
1300
+ } else {
1301
+ startFetch(promise, key);
1302
+ }
1303
+ });
1262
1304
  function dispose() {
1263
1305
  if (referencedKeys.size > 0) {
1264
1306
  const store = getEntityStore();
@@ -1284,11 +1326,25 @@ function query(source, options = {}) {
1284
1326
  }
1285
1327
  inflightKeys.clear();
1286
1328
  }
1329
+ function createClearData(meta) {
1330
+ return () => {
1331
+ untrack(() => {
1332
+ entityBacked.value = false;
1333
+ rawData.value = undefined;
1334
+ loading.value = true;
1335
+ });
1336
+ const cacheKey = untrack(() => getCacheKey());
1337
+ cache.delete(cacheKey);
1338
+ const queryKey = customKey ?? meta.entityType;
1339
+ getEntityStore().queryIndices.clear(queryKey);
1340
+ getQueryEnvelopeStore().delete(queryKey);
1341
+ };
1342
+ }
1287
1343
  let unsubscribeBus;
1288
1344
  let unregisterFromRegistry;
1289
- if (entityMeta && enabled && !isSSR()) {
1345
+ if (entityMeta && !isSSR()) {
1290
1346
  unsubscribeBus = getMutationEventBus().subscribe(entityMeta.entityType, refetch);
1291
- unregisterFromRegistry = registerActiveQuery(entityMeta, refetch);
1347
+ unregisterFromRegistry = registerActiveQuery(entityMeta, refetch, createClearData(entityMeta));
1292
1348
  }
1293
1349
  _tryOnCleanup(dispose);
1294
1350
  return {
@@ -1296,6 +1352,7 @@ function query(source, options = {}) {
1296
1352
  loading,
1297
1353
  revalidating,
1298
1354
  error,
1355
+ idle,
1299
1356
  refetch,
1300
1357
  revalidate: refetch,
1301
1358
  dispose
@@ -1420,4 +1477,4 @@ function queryMatch(queryResult, handlers) {
1420
1477
  return wrapper;
1421
1478
  }
1422
1479
 
1423
- export { MemoryCache, invalidate, deriveKey, FieldSelectionTracker, registerRelationSchema, getRelationSchema, resetRelationSchemas_TEST_ONLY, EntityStore, QueryEnvelopeStore, getEntityStore, getQueryEnvelopeStore, getMutationEventBus, query, queryMatch };
1480
+ export { MemoryCache, deriveKey, FieldSelectionTracker, registerRelationSchema, getRelationSchema, resetRelationSchemas_TEST_ONLY, EntityStore, QueryEnvelopeStore, getEntityStore, getQueryEnvelopeStore, getMutationEventBus, query, queryMatch };
@@ -1,9 +1,5 @@
1
- import {
2
- styleObjectToString
3
- } from "./chunk-4xkw6h1s.js";
4
1
  import {
5
2
  _tryOnCleanup,
6
- deferredDomEffect,
7
3
  getSSRContext,
8
4
  popScope,
9
5
  pushScope,
@@ -95,66 +91,12 @@ function executeOnMount(callback) {
95
91
  }
96
92
  }
97
93
 
98
- // src/dom/attributes.ts
99
- function __attr(el, name, fn) {
100
- return deferredDomEffect(() => {
101
- const value = fn();
102
- if (value == null || value === false) {
103
- el.removeAttribute(name);
104
- } else if (value === true) {
105
- el.setAttribute(name, "");
106
- } else if (name === "style" && typeof value === "object") {
107
- el.setAttribute(name, styleObjectToString(value));
108
- } else {
109
- el.setAttribute(name, value);
110
- }
111
- });
112
- }
113
- function __prop(el, name, fn) {
114
- return deferredDomEffect(() => {
115
- const value = fn();
116
- if (value == null) {
117
- Reflect.set(el, name, typeof Reflect.get(el, name) === "boolean" ? false : "");
118
- } else {
119
- Reflect.set(el, name, value);
120
- }
121
- if (name === "selected") {
122
- if (value) {
123
- el.setAttribute(name, "");
124
- } else {
125
- el.removeAttribute(name);
126
- }
127
- }
128
- });
129
- }
130
- function __show(el, fn) {
131
- const originalDisplay = el.style.display;
132
- return deferredDomEffect(() => {
133
- el.style.display = fn() ? originalDisplay : "none";
134
- });
135
- }
136
- function __classList(el, classMap) {
137
- const disposers = [];
138
- for (const [className, fn] of Object.entries(classMap)) {
139
- disposers.push(deferredDomEffect(() => {
140
- if (fn()) {
141
- el.classList.add(className);
142
- } else {
143
- el.classList.remove(className);
144
- }
145
- }));
146
- }
147
- return () => {
148
- for (const dispose of disposers) {
149
- dispose();
150
- }
151
- };
152
- }
153
-
154
94
  // src/dom/events.ts
155
95
  function __on(el, event, handler) {
156
96
  el.addEventListener(event, handler);
157
- return () => el.removeEventListener(event, handler);
97
+ const cleanup = () => el.removeEventListener(event, handler);
98
+ _tryOnCleanup(cleanup);
99
+ return cleanup;
158
100
  }
159
101
 
160
- export { __pushMountFrame, __flushMountFrame, __discardMountFrame, beginDeferringMounts, flushDeferredMounts, discardDeferredMounts, onMount, __attr, __prop, __show, __classList, __on };
102
+ export { __pushMountFrame, __flushMountFrame, __discardMountFrame, beginDeferringMounts, flushDeferredMounts, discardDeferredMounts, onMount, __on };
@@ -1,3 +1,69 @@
1
+ // src/dom/svg-tags.ts
2
+ var SVG_TAGS = new Set([
3
+ "svg",
4
+ "path",
5
+ "circle",
6
+ "ellipse",
7
+ "rect",
8
+ "line",
9
+ "polyline",
10
+ "polygon",
11
+ "g",
12
+ "defs",
13
+ "symbol",
14
+ "use",
15
+ "text",
16
+ "tspan",
17
+ "image",
18
+ "foreignObject",
19
+ "filter",
20
+ "feGaussianBlur",
21
+ "feOffset",
22
+ "feColorMatrix",
23
+ "feBlend",
24
+ "feMerge",
25
+ "feMergeNode",
26
+ "feComposite",
27
+ "feFlood",
28
+ "linearGradient",
29
+ "radialGradient",
30
+ "stop",
31
+ "pattern",
32
+ "clipPath",
33
+ "mask",
34
+ "animate",
35
+ "animateTransform",
36
+ "set",
37
+ "marker",
38
+ "desc"
39
+ ]);
40
+ var SVG_NS = "http://www.w3.org/2000/svg";
41
+ function isSVGTag(tag) {
42
+ return SVG_TAGS.has(tag);
43
+ }
44
+ var SVG_ATTR_MAP = {
45
+ strokeWidth: "stroke-width",
46
+ strokeLinecap: "stroke-linecap",
47
+ strokeLinejoin: "stroke-linejoin",
48
+ strokeDasharray: "stroke-dasharray",
49
+ strokeDashoffset: "stroke-dashoffset",
50
+ strokeOpacity: "stroke-opacity",
51
+ fillOpacity: "fill-opacity",
52
+ fillRule: "fill-rule",
53
+ clipRule: "clip-rule",
54
+ clipPath: "clip-path",
55
+ stopColor: "stop-color",
56
+ stopOpacity: "stop-opacity",
57
+ floodColor: "flood-color",
58
+ floodOpacity: "flood-opacity",
59
+ colorInterpolation: "color-interpolation",
60
+ colorInterpolationFilters: "color-interpolation-filters",
61
+ viewBox: "viewBox"
62
+ };
63
+ function normalizeSVGAttr(attr) {
64
+ return SVG_ATTR_MAP[attr] ?? attr;
65
+ }
66
+
1
67
  // src/dom/style.ts
2
68
  function camelToKebab(prop) {
3
69
  const third = prop[2];
@@ -70,4 +136,4 @@ function styleObjectToString(style) {
70
136
  return parts.join("; ");
71
137
  }
72
138
 
73
- export { styleObjectToString };
139
+ export { SVG_NS, isSVGTag, normalizeSVGAttr, styleObjectToString };