aktion-runtime 0.5.6 → 0.5.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.
@@ -60,6 +60,25 @@ export declare class AktionElement extends HTMLElement {
60
60
  */
61
61
  private forceFullRender;
62
62
  private parseErrors;
63
+ /**
64
+ * Diagnostics raised while loading a program from the `src` attribute
65
+ * (fetch / link failures, unresolved imports). Tracked separately from
66
+ * `parseErrors` so they survive the `replan()` that mounting the linked
67
+ * program triggers, and are merged into the error banner + `error` event.
68
+ */
69
+ private srcDiagnostics;
70
+ /**
71
+ * Monotonic token guarding overlapping `src` loads. A rapid `src` change
72
+ * (or a reconnect mid-fetch) bumps the token so a stale in-flight load
73
+ * resolves into a no-op instead of clobbering the current program.
74
+ */
75
+ private srcLoadToken;
76
+ /**
77
+ * True once `connectedCallback` has run at least once. Lets
78
+ * `attributeChangedCallback` distinguish the initial attribute upgrade
79
+ * (handled by `connectedCallback`) from a genuine later `src` change.
80
+ */
81
+ private hasConnected;
63
82
  /**
64
83
  * Token keys most recently applied by an in-script `$theme({...})`
65
84
  * declaration. We remember them so the next render can clear stale
@@ -153,6 +172,30 @@ export declare class AktionElement extends HTMLElement {
153
172
  * element is driven by the streamed-string path.
154
173
  */
155
174
  get sourceId(): string | null;
175
+ /** Current `src` attribute value, or `null` when none is set. */
176
+ get src(): string | null;
177
+ set src(value: string | null);
178
+ /**
179
+ * Load the program from an external `.aktion` file referenced by the `src`
180
+ * attribute. The entry is fetched relative to the document, linked through
181
+ * the in-browser project linker (so an entry that `import`s other modules
182
+ * resolves and fetches its whole graph), and mounted as a compiled program.
183
+ *
184
+ * A monotonic token guards against overlapping loads: a rapid `src` change
185
+ * or a reconnect mid-fetch bumps the token, so a stale in-flight load
186
+ * resolves into a no-op instead of clobbering the current program. Fetch /
187
+ * link failures and unresolved imports surface through the same error banner
188
+ * and `error` event as parse errors.
189
+ */
190
+ loadFromSrc(src: string): Promise<void>;
191
+ /** A `src` load is stale if a newer one started or the element detached. */
192
+ private isStaleSrcLoad;
193
+ /**
194
+ * Surface a `src`-loading failure: record it, refresh the banner, and
195
+ * bubble an `error` event so host pages can react (mirrors how parse
196
+ * errors are reported).
197
+ */
198
+ private reportSrcError;
156
199
  /** Append a streaming chunk and re-render. */
157
200
  appendChunk(chunk: string): void;
158
201
  setTheme(theme: ThemeInput): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aktion-runtime",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
4
4
  "description": "Aktion is a single web component that turns a compact, streaming-first DSL into a rich, interactive UI inside its shadow DOM. Works in React, Vue, Angular, Svelte, plain HTML — or no framework at all.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",