@fluixi/template-parser 1.0.0-alpha.107 → 1.0.0-alpha.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/parser.cjs CHANGED
@@ -236,12 +236,18 @@ var CORE_DIRECTIVES = [
236
236
  {
237
237
  id: "load",
238
238
  match: (n) => n.startsWith("load:"),
239
- build: (raw) => ({
240
- kind: "LoadDirective",
241
- strategy: raw.name.slice("load:".length),
242
- modifier: raw.value && raw.value.kind === "static" ? raw.value.value : null,
243
- loc: raw.loc
244
- })
239
+ build: (raw) => {
240
+ if (raw.value && raw.value.kind !== "static") {
241
+ raw.report("invalid-binding", `'${raw.name}' needs a literal value, not an expression: the strategy is compile-time.`);
242
+ }
243
+ return {
244
+ kind: "LoadDirective",
245
+ strategy: raw.name.slice("load:".length),
246
+ modifier: raw.value && raw.value.kind === "static" ? raw.value.value : null,
247
+ ...raw.value && raw.value.kind !== "static" ? { dynamic: true } : {},
248
+ loc: raw.loc
249
+ };
250
+ }
245
251
  },
246
252
  // Custom directive: `use=${d}` or `use:tooltip[=${opts}]`.
247
253
  {
@@ -329,17 +335,64 @@ function resolveAttribute(raw, directives = CORE_DIRECTIVES, ctx = { component:
329
335
  // src/tags.ts
330
336
  var SVG_TAGS = /* @__PURE__ */ new Set([
331
337
  "svg",
338
+ "g",
339
+ "defs",
340
+ "symbol",
341
+ "use",
342
+ "switch",
343
+ "view",
344
+ "desc",
345
+ "metadata",
332
346
  "path",
333
347
  "circle",
334
- "rect",
348
+ "ellipse",
335
349
  "line",
336
350
  "polygon",
337
351
  "polyline",
338
- "ellipse",
339
- "g",
340
- "defs",
352
+ "rect",
353
+ "image",
354
+ "text",
355
+ "tspan",
356
+ "textPath",
357
+ "linearGradient",
358
+ "radialGradient",
359
+ "stop",
360
+ "pattern",
361
+ "mask",
341
362
  "clipPath",
342
- "text"
363
+ "marker",
364
+ "foreignObject",
365
+ "animate",
366
+ "animateMotion",
367
+ "animateTransform",
368
+ "mpath",
369
+ "set",
370
+ "filter",
371
+ "feBlend",
372
+ "feColorMatrix",
373
+ "feComponentTransfer",
374
+ "feComposite",
375
+ "feConvolveMatrix",
376
+ "feDiffuseLighting",
377
+ "feDisplacementMap",
378
+ "feDistantLight",
379
+ "feDropShadow",
380
+ "feFlood",
381
+ "feFuncA",
382
+ "feFuncB",
383
+ "feFuncG",
384
+ "feFuncR",
385
+ "feGaussianBlur",
386
+ "feImage",
387
+ "feMerge",
388
+ "feMergeNode",
389
+ "feMorphology",
390
+ "feOffset",
391
+ "fePointLight",
392
+ "feSpecularLighting",
393
+ "feSpotLight",
394
+ "feTile",
395
+ "feTurbulence"
343
396
  ]);
344
397
  var RAW_TEXT_ELEMENTS = /* @__PURE__ */ new Set(["script", "style", "textarea", "title"]);
345
398
  var VOID_ELEMENTS = /* @__PURE__ */ new Set([