@symbiotejs/symbiote 3.4.7 → 3.5.0

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/AI_REFERENCE.md CHANGED
@@ -775,14 +775,23 @@ Enable verbose warnings during development:
775
775
  Symbiote.devMode = true;
776
776
  ```
777
777
 
778
+ ### Dev messages module
779
+
780
+ All warning/error strings are in an optional module. Without it, warnings print short codes like `[Symbiote W5]`. Import once to get full messages and auto-enable `devMode`:
781
+ ```js
782
+ import '@symbiotejs/symbiote/core/devMessages.js';
783
+ ```
784
+
778
785
  **Always-on** (regardless of `devMode`):
779
- - `[Symbiote]` prefixed warnings for PubSub errors, duplicate tags, type mismatches, router issues
780
- - `this` in template interpolation error (`html` tag detects `${this.x}` usage)
786
+ - `W1` PubSub: cannot read/publish/subscribe property not found
787
+ - `W3` context already registered, `W4` context not found
788
+ - `W5` custom template not found, `W8` tag already registered, `W9` CSS data parse error
789
+ - `W13`/`W14` AppRouter messages, `W16` itemize data type error
790
+ - `E15` `this` in template interpolation error (`html` tag detects `${this.x}` usage)
781
791
 
782
792
  **Dev-only** (`devMode = true`):
783
- - Unresolved binding keys warns when a template binding auto-initializes to `null` (likely typo)
784
- - `*prop` without `ctx` attribute or `--ctx` CSS variable warns that shared context won't be created
785
- - `*prop` conflict — warns when a later component tries to set a different initial value for the same shared prop
793
+ - `W2` type change on publish, `W6` `*prop` without ctx, `W7` shared prop conflict
794
+ - `W10` CSS data binding in SSR, `W11` unresolved binding key, `W12` text-node binding in SSR/ISO
786
795
 
787
796
  ---
788
797
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.5.0
4
+
5
+ ### Added
6
+
7
+ - **External dev messages module (`core/devMessages.js`).** All warning and error message strings have been extracted from core files into an optional module. Core files now emit short numeric codes (e.g. `[Symbiote W5]`). Import `@symbiotejs/symbiote/core/devMessages.js` once to get full human-readable messages. This reduces the core bundle size by removing all formatting strings from `PubSub.js`, `Symbiote.js`, `tpl-processors.js`, `AppRouter.js`, `html.js`, and both itemize processors.
8
+
9
+ - **`core/warn.js` — lightweight message dispatcher.** Exports `warnMsg(code, ...args)`, `errMsg(code, ...args)`, and `registerMessages(map)`. All core files now use this dispatcher instead of inline `console.warn`/`console.error` calls.
10
+
11
+ - **AppRouter: `title` accepts functions.** Route descriptors and `setDefaultTitle()` now accept `() => String` in addition to plain strings. The function is called at navigation time, enabling dynamic or localized page titles:
12
+ ```js
13
+ AppRouter.setDefaultTitle(() => i18n('app.title'));
14
+ AppRouter.initRoutingCtx('R', {
15
+ home: { pattern: '/', title: () => i18n('home.title'), default: true },
16
+ });
17
+ ```
18
+
3
19
  ## 3.4.7
4
20
 
5
21
  ### Fixed
package/README.md CHANGED
@@ -20,7 +20,7 @@ Symbiote.js gives you the convenience of a modern framework while staying close
20
20
  - **Computed properties** — reactive derived state with microtask batching.
21
21
  - **Path-based router** — optional `AppRouter` module with `:param` extraction, route guards, and lazy loading.
22
22
  - **Exit animations** — `animateOut(el)` for CSS-driven exit transitions, integrated into itemize API.
23
- - **Dev mode** — `Symbiote.devMode` enables verbose warnings for unresolved bindings.
23
+ - **Dev mode** — `Symbiote.devMode` enables verbose warnings; import `devMessages.js` for full human-readable messages.
24
24
  - **DSD hydration** — `ssrMode` supports both light DOM and Declarative Shadow DOM.
25
25
  - **Class property fallback** — binding keys not in `init$` fall back to own class properties/methods.
26
26
  - And [more](https://github.com/symbiotejs/symbiote.js/blob/main/CHANGELOG.md).
@@ -64,7 +64,6 @@ import Symbiote, { html, css } from '@symbiotejs/symbiote';
64
64
  ## Isomorphic Web Components
65
65
 
66
66
  One component. Server-rendered or client-rendered — automatically. Set `isoMode = true` and the component figures it out: if server-rendered content exists, it hydrates; otherwise it renders from template. No conditional logic, no separate server/client versions:
67
-
68
67
  ```js
69
68
  class MyComponent extends Symbiote {
70
69
  isoMode = true;
@@ -75,7 +74,7 @@ class MyComponent extends Symbiote {
75
74
  }
76
75
 
77
76
  MyComponent.template = html`
78
- <h2>{{count}}</h2>
77
+ <h2 ${{textContent: 'count'}}></h2>
79
78
  <button ${{onclick: 'increment'}}>Click me!</button>
80
79
  `;
81
80
  MyComponent.reg('my-component');
@@ -157,10 +156,9 @@ The `html` function supports two interpolation modes:
157
156
  - **Object** → reactive binding: `${{onclick: 'handler'}}`
158
157
  - **String/number** → native concatenation: `${pageTitle}`
159
158
 
160
- ### Itemize (lists)
161
-
162
- Render lists from data arrays with efficient diffing:
159
+ ### Itemize (dynamic reactive lists)
163
160
 
161
+ Render lists from data arrays with efficient updates:
164
162
  ```js
165
163
  class TaskList extends Symbiote {
166
164
  tasks = [
@@ -176,11 +174,11 @@ class TaskList extends Symbiote {
176
174
  }
177
175
 
178
176
  TaskList.template = html`
179
- <ul itemize="tasks">
177
+ <div itemize="tasks">
180
178
  <template>
181
- <li ${{onclick: '^onItemClick'}}>{{name}}</li>
179
+ <div ${{onclick: '^onItemClick'}}>{{name}}</div>
182
180
  </template>
183
- </ul>
181
+ </div>
184
182
  `;
185
183
  ```
186
184
 
@@ -312,18 +310,12 @@ Components can read CSS custom properties as reactive state via `cssInit$`:
312
310
 
313
311
  ```css
314
312
  my-widget {
315
- --columns: 3;
316
313
  --label: 'Click me';
317
314
  }
318
315
  ```
319
316
 
320
317
  ```js
321
- class MyWidget extends Symbiote {
322
- cssInit$ = {
323
- '--columns': 1,
324
- '--label': '',
325
- }
326
- }
318
+ class MyWidget extends Symbiote {...}
327
319
 
328
320
  MyWidget.template = html`
329
321
  <span>{{--label}}</span>
package/core/AppRouter.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import PubSub from './PubSub.js';
2
+ import { warnMsg } from './warn.js';
2
3
 
3
4
  export class AppRouter {
4
5
 
5
6
  /**
6
7
  * @typedef {{
7
- * title?: String,
8
+ * title?: String | (() => String),
8
9
  * default?: Boolean,
9
10
  * error?: Boolean,
10
11
  * pattern?: String,
@@ -49,14 +50,19 @@ export class AppRouter {
49
50
  }
50
51
 
51
52
  static #print(msg) {
52
- console.warn(`[Symbiote > AppRouter] ${msg}`);
53
+ warnMsg(13, msg);
53
54
  }
54
55
 
55
- /** @param {String} title */
56
+ /** @param {String | (() => String)} title */
56
57
  static setDefaultTitle(title) {
57
58
  this.defaultTitle = title;
58
59
  }
59
60
 
61
+ /** @param {String | (() => String) | undefined} title */
62
+ static #resolveTitle(title) {
63
+ return typeof title === 'function' ? title() : title;
64
+ }
65
+
60
66
  /** @param {Object<string, {}>} map */
61
67
  static setRoutingMap(map) {
62
68
  Object.assign(this.appMap, map);
@@ -232,8 +238,9 @@ export class AppRouter {
232
238
  }
233
239
  }
234
240
 
235
- if (routeScheme.title) {
236
- document.title = routeScheme.title;
241
+ let resolvedTitle = this.#resolveTitle(routeScheme.title);
242
+ if (resolvedTitle) {
243
+ document.title = resolvedTitle;
237
244
  }
238
245
 
239
246
  this.#currentState = routeBase;
@@ -290,11 +297,11 @@ export class AppRouter {
290
297
  }
291
298
  }
292
299
 
293
- let title = routeScheme.title || this.defaultTitle || '';
300
+ let title = this.#resolveTitle(routeScheme.title) || this.#resolveTitle(this.defaultTitle) || '';
294
301
  try {
295
302
  window.history.pushState(null, title, url);
296
303
  } catch (err) {
297
- console.warn('[Symbiote > AppRouter] History API is not available.');
304
+ warnMsg(14);
298
305
  }
299
306
  document.title = title;
300
307
  }
@@ -354,7 +361,7 @@ export class AppRouter {
354
361
  window.addEventListener(this.routingEventName, (/** @type {CustomEvent} */ e) => {
355
362
  routingCtx.multiPub({
356
363
  options: e.detail.options,
357
- title: e.detail.options?.title || this.defaultTitle || '',
364
+ title: this.#resolveTitle(e.detail.options?.title) || this.#resolveTitle(this.defaultTitle) || '',
358
365
  route: e.detail.route,
359
366
  });
360
367
  });
@@ -365,7 +372,7 @@ export class AppRouter {
365
372
  routingCtx.multiPub({
366
373
  route: this.defaultRoute,
367
374
  options: {},
368
- title: defaultDesc?.title || this.defaultTitle || '',
375
+ title: this.#resolveTitle(defaultDesc?.title) || this.#resolveTitle(this.defaultTitle) || '',
369
376
  });
370
377
  }
371
378
  return routingCtx;
package/core/PubSub.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { DICT } from './dictionary.js';
2
+ import { warnMsg } from './warn.js';
2
3
 
3
4
  // structuredClone() is limited by supported types, so we use custom cloning:
4
5
  function cloneObj(obj) {
@@ -73,8 +74,7 @@ export class PubSub {
73
74
  * @param {*} prop
74
75
  */
75
76
  static #warn(actionName, prop, ctx) {
76
- let uid = String(ctx?.uid || 'local');
77
- console.warn(`[Symbiote] PubSub (${uid}): cannot ${actionName}. Property: "${prop}"`);
77
+ warnMsg(1, String(ctx?.uid || 'local'), actionName, prop);
78
78
  }
79
79
 
80
80
  /**
@@ -270,11 +270,7 @@ export class PubSub {
270
270
  return;
271
271
  }
272
272
  if (PubSub.devMode && !(this.store[prop] === null || val === null) && typeof this.store[prop] !== typeof val) {
273
- let uid = String(this.uid || 'local');
274
- console.warn(
275
- `[Symbiote] PubSub (${uid}): type change for "${String(prop)}" [${typeof this.store[prop]} → ${typeof val}].\n`
276
- + `Previous: ${JSON.stringify(this.store[prop])}\nNew: ${JSON.stringify(val)}`
277
- );
273
+ warnMsg(2, String(this.uid || 'local'), String(prop), typeof this.store[prop], typeof val, JSON.stringify(this.store[prop]), JSON.stringify(val));
278
274
  }
279
275
  this.store[prop] = val;
280
276
  this.notify(prop, val);
@@ -375,7 +371,7 @@ export class PubSub {
375
371
  /** @type {PubSub} */
376
372
  let data = PubSub.globalStore.get(uid);
377
373
  if (data) {
378
- console.warn(`[Symbiote] PubSub: context "${uid}" is already registered. Returning existing instance.`);
374
+ warnMsg(3, uid);
379
375
  } else {
380
376
  data = new PubSub(schema);
381
377
  data.uid = uid;
@@ -404,10 +400,7 @@ export class PubSub {
404
400
  * @returns {PubSub}
405
401
  */
406
402
  static getCtx(uid, notify = true) {
407
- return PubSub.globalStore.get(uid) || (notify && console.warn(
408
- `[Symbiote] PubSub: context "${String(uid)}" not found.\n`
409
- + `Available contexts: [${[...PubSub.globalStore.keys()].map(String).join(', ')}]`
410
- ), null);
403
+ return PubSub.globalStore.get(uid) || (notify && warnMsg(4, String(uid), [...PubSub.globalStore.keys()].map(String).join(', ')), null);
411
404
  }
412
405
  }
413
406
 
package/core/Symbiote.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import PubSub from './PubSub.js';
2
+ import { warnMsg } from './warn.js';
2
3
  import { DICT } from './dictionary.js';
3
4
  import { animateOut } from './animateOut.js';
4
5
  import { setNestedProp } from '../utils/setNestedProp.js';
@@ -94,7 +95,7 @@ export class Symbiote extends HTMLElement {
94
95
  // @ts-expect-error
95
96
  template = customTpl.content.cloneNode(true);
96
97
  } else {
97
- console.warn(`[Symbiote] <${this.localName}>: custom template "${customTplSelector}" not found.`);
98
+ warnMsg(5, this.localName, customTplSelector);
98
99
  }
99
100
  }
100
101
  }
@@ -427,18 +428,13 @@ export class Symbiote extends HTMLElement {
427
428
  let sharedVal = this.init$[prop];
428
429
  if (!this.ctxName) {
429
430
  if (Symbiote.devMode) {
430
- console.warn(
431
- `[Symbiote] "${this.localName}" uses *${sharedName} without ctx attribute or --ctx CSS variable. `
432
- + 'Set ctx="name" or --ctx to share state.'
433
- );
431
+ warnMsg(6, this.localName, sharedName);
434
432
  }
435
433
  } else {
436
434
  if (Symbiote.devMode && this.sharedCtx.has(sharedName)) {
437
435
  let existing = this.sharedCtx.read(sharedName);
438
436
  if (existing !== sharedVal && typeof sharedVal !== 'function') {
439
- console.warn(
440
- `[Symbiote] Shared prop "${sharedName}" already has value. Keeping existing.`
441
- );
437
+ warnMsg(7, sharedName);
442
438
  }
443
439
  }
444
440
  this.sharedCtx.add(sharedName, sharedVal);
@@ -577,10 +573,7 @@ export class Symbiote extends HTMLElement {
577
573
  let registeredClass = window.customElements.get(tagName);
578
574
  if (registeredClass) {
579
575
  if (!isAlias && registeredClass !== this) {
580
- console.warn(
581
- `[Symbiote] <${tagName}> is already registered (class: ${registeredClass.name}).\n`
582
- + `Attempted re-registration with class "${this.name}" — skipped.`
583
- );
576
+ warnMsg(8, tagName, registeredClass.name, this.name);
584
577
  }
585
578
  return this;
586
579
  }
@@ -641,7 +634,7 @@ export class Symbiote extends HTMLElement {
641
634
  try {
642
635
  this.#cssDataCache[propName] = parseCssPropertyValue(val);
643
636
  } catch (e) {
644
- !silentCheck && console.warn(`[Symbiote] <${this.localName}>: CSS data parse error for "${propName}". Check that the CSS custom property is defined.`);
637
+ !silentCheck && warnMsg(9, this.localName, propName);
645
638
  this.#cssDataCache[propName] = null;
646
639
  }
647
640
  }
@@ -672,10 +665,7 @@ export class Symbiote extends HTMLElement {
672
665
  */
673
666
  bindCssData(propName, initValue = '') {
674
667
  if (Symbiote.#devMode && (this.ssrMode || this.isoMode)) {
675
- console.warn(
676
- `[Symbiote dev] <${this.localName}>: CSS data binding "${propName}" will not read computed styles during SSR. `
677
- + 'The init value will be used instead.'
678
- );
668
+ warnMsg(10, this.localName, propName);
679
669
  }
680
670
  if (!this.#boundCssProps) {
681
671
  this.#boundCssProps = new Set();
@@ -0,0 +1,59 @@
1
+ import { registerMessages } from './warn.js';
2
+ import Symbiote from './Symbiote.js';
3
+
4
+ Symbiote.devMode = true;
5
+
6
+ registerMessages(new Map([
7
+ // PubSub
8
+ [1, (uid, action, prop) =>
9
+ `[Symbiote] PubSub (${uid}): cannot ${action}. Property: "${prop}"`],
10
+ [2, (uid, prop, prevType, newType, prev, next) =>
11
+ `[Symbiote] PubSub (${uid}): type change for "${prop}" [${prevType} → ${newType}].\n`
12
+ + `Previous: ${prev}\nNew: ${next}`],
13
+ [3, (uid) =>
14
+ `[Symbiote] PubSub: context "${uid}" is already registered. Returning existing instance.`],
15
+ [4, (uid, keys) =>
16
+ `[Symbiote] PubSub: context "${uid}" not found.\n`
17
+ + `Available contexts: [${keys}]`],
18
+
19
+ // Symbiote
20
+ [5, (localName, selector) =>
21
+ `[Symbiote] <${localName}>: custom template "${selector}" not found.`],
22
+ [6, (localName, sharedName) =>
23
+ `[Symbiote] "${localName}" uses *${sharedName} without ctx attribute or --ctx CSS variable. `
24
+ + 'Set ctx="name" or --ctx to share state.'],
25
+ [7, (sharedName) =>
26
+ `[Symbiote] Shared prop "${sharedName}" already has value. Keeping existing.`],
27
+ [8, (tagName, existingClass, newClass) =>
28
+ `[Symbiote] <${tagName}> is already registered (class: ${existingClass}).\n`
29
+ + `Attempted re-registration with class "${newClass}" — skipped.`],
30
+ [9, (localName, propName) =>
31
+ `[Symbiote] <${localName}>: CSS data parse error for "${propName}". Check that the CSS custom property is defined.`],
32
+ [10, (localName, propName) =>
33
+ `[Symbiote dev] <${localName}>: CSS data binding "${propName}" will not read computed styles during SSR. `
34
+ + 'The init value will be used instead.'],
35
+
36
+ // tpl-processors
37
+ [11, (localName, valKey, knownKeys) =>
38
+ `[Symbiote dev] <${localName}>: binding key "${valKey}" not found in init$ (auto-initialized to null).\n`
39
+ + `Known keys: [${knownKeys}]`],
40
+ [12, (localName, prop) =>
41
+ `[Symbiote dev] <${localName}>: text-node binding "{{${prop}}}" has no hydration attribute. `
42
+ + 'In ssrMode/isoMode it will be rendered by the server but won\'t update on the client. '
43
+ + 'Use property binding (${{textContent: \'' + prop + '\'}}) for hydratable text.'],
44
+
45
+ // AppRouter
46
+ [13, (msg) =>
47
+ `[Symbiote > AppRouter] ${msg}`],
48
+ [14, () =>
49
+ '[Symbiote > AppRouter] History API is not available.'],
50
+
51
+ // html
52
+ [15, (val) =>
53
+ `[Symbiote > html] \`this\` used in template interpolation (value: ${val}).\n`
54
+ + 'Templates are context-free — use ${{ prop: \'stateKey\' }} binding syntax instead.'],
55
+
56
+ // itemizeProcessor
57
+ [16, (localName, dataType, data) =>
58
+ `[Symbiote] <${localName}>: itemize data must be Array or Object, got ${dataType}: ${data}`],
59
+ ]));
package/core/html.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { DICT } from './dictionary.js';
2
+ import { errMsg } from './warn.js';
2
3
 
3
4
  /** @type {String[]} */
4
5
  export const RESERVED_ATTRIBUTES = [
@@ -24,10 +25,7 @@ export function html(parts, ...props) {
24
25
  if (idx >= props.length) return;
25
26
  let val = props[idx];
26
27
  if (val === undefined || val === null) {
27
- console.error(
28
- `[Symbiote > html] \`this\` used in template interpolation (value: ${val}).\n`
29
- + 'Templates are context-free — use ${{ prop: \'stateKey\' }} binding syntax instead.'
30
- );
28
+ errMsg(15, val);
31
29
  return;
32
30
  }
33
31
  if (val?.constructor === Object) {
@@ -1,4 +1,5 @@
1
1
  import { animateOut } from './animateOut.js';
2
+ import { warnMsg } from './warn.js';
2
3
  import { setupItemize } from './itemizeSetup.js';
3
4
 
4
5
  /**
@@ -57,7 +58,7 @@ export function itemizeProcessor(fr, fnCtx) {
57
58
  items.push(init);
58
59
  }
59
60
  } else {
60
- console.warn(`[Symbiote] <${fnCtx.localName}>: itemize data must be Array or Object, got ${typeof data}:`, data);
61
+ warnMsg(16, fnCtx.localName, typeof data, data);
61
62
  return;
62
63
  }
63
64
 
@@ -1,4 +1,5 @@
1
1
  import { animateOut } from './animateOut.js';
2
+ import { warnMsg } from './warn.js';
2
3
  import { setupItemize } from './itemizeSetup.js';
3
4
 
4
5
  /**
@@ -57,7 +58,7 @@ export function itemizeProcessor(fr, fnCtx) {
57
58
  }
58
59
  fillItems(items);
59
60
  } else {
60
- console.warn(`[Symbiote] <${fnCtx.localName}>: itemize data must be Array or Object, got ${typeof data}:`, data);
61
+ warnMsg(16, fnCtx.localName, typeof data, data);
61
62
  }
62
63
  }, !clientSSR);
63
64
  });
@@ -1,4 +1,5 @@
1
1
  import { DICT } from './dictionary.js';
2
+ import { warnMsg } from './warn.js';
2
3
  import { setNestedProp } from '../utils/setNestedProp.js';
3
4
  import { ownElements, isOwnNode } from './ownElements.js';
4
5
  import { initPropFallback } from './initPropFallback.js';
@@ -64,10 +65,7 @@ function domBindProcessor(fr, fnCtx) {
64
65
  // Dev-only: warn about bindings that aren't in init$ (likely typos)
65
66
  if (fnCtx.localCtx.read(valKey) === null && fnCtx.Symbiote?.devMode) {
66
67
  let known = Object.keys(fnCtx.init$).filter((k) => !k.startsWith('+'));
67
- console.warn(
68
- `[Symbiote dev] <${fnCtx.localName}>: binding key "${valKey}" not found in init$ (auto-initialized to null).\n`
69
- + `Known keys: [${known.join(', ')}]`
70
- );
68
+ warnMsg(11, fnCtx.localName, valKey, known.join(', '));
71
69
  }
72
70
  }
73
71
  let initVal = fnCtx.$[valKey];
@@ -156,11 +154,7 @@ const txtNodesProcessor = function (fr, fnCtx) {
156
154
  initPropFallback(fnCtx, prop);
157
155
  }
158
156
  if (fnCtx.Symbiote?.devMode && (fnCtx.ssrMode || fnCtx.isoMode)) {
159
- console.warn(
160
- `[Symbiote dev] <${fnCtx.localName}>: text-node binding "{{${prop}}}" has no hydration attribute. `
161
- + 'In ssrMode/isoMode it will be rendered by the server but won\'t update on the client. '
162
- + 'Use property binding (${{textContent: \'' + prop + '\'}}) for hydratable text.'
163
- );
157
+ warnMsg(12, fnCtx.localName, prop);
164
158
  }
165
159
  fnCtx.sub(prop, (val) => {
166
160
  tNode.textContent = val;
package/core/warn.js ADDED
@@ -0,0 +1,27 @@
1
+ /** @type {Map<number, (...args: any[]) => string>} */
2
+ let messages = globalThis.__SYMBIOTE_DEV_MESSAGES || (globalThis.__SYMBIOTE_DEV_MESSAGES = new Map());
3
+
4
+ /**
5
+ * @param {number} code
6
+ * @param {...any} args
7
+ */
8
+ export function warnMsg(code, ...args) {
9
+ let fmt = messages.get(code);
10
+ console.warn(fmt ? fmt(...args) : `[Symbiote W${code}]`);
11
+ }
12
+
13
+ /**
14
+ * @param {number} code
15
+ * @param {...any} args
16
+ */
17
+ export function errMsg(code, ...args) {
18
+ let fmt = messages.get(code);
19
+ console.error(fmt ? fmt(...args) : `[Symbiote E${code}]`);
20
+ }
21
+
22
+ /** @param {Map<number, (...args: any[]) => string>} map */
23
+ export function registerMessages(map) {
24
+ for (let [code, fmt] of map) {
25
+ messages.set(code, fmt);
26
+ }
27
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@symbiotejs/symbiote",
4
- "version": "3.4.7",
4
+ "version": "3.5.0",
5
5
  "description": "Symbiote.js - zero-dependency close-to-platform frontend library to build super-powered web components",
6
6
  "author": "team@rnd-pro.com",
7
7
  "license": "MIT",
@@ -63,6 +63,10 @@
63
63
  "types": "./types/core/css.d.ts",
64
64
  "default": "./core/css.js"
65
65
  },
66
+ "./core/devMessages.js": {
67
+ "types": "./types/core/devMessages.d.ts",
68
+ "default": "./core/devMessages.js"
69
+ },
66
70
  "./core/dictionary.js": {
67
71
  "types": "./types/core/dictionary.d.ts",
68
72
  "default": "./core/dictionary.js"
@@ -103,6 +107,10 @@
103
107
  "types": "./types/core/tpl-processors.d.ts",
104
108
  "default": "./core/tpl-processors.js"
105
109
  },
110
+ "./core/warn.js": {
111
+ "types": "./types/core/warn.d.ts",
112
+ "default": "./core/warn.js"
113
+ },
106
114
  "./utils/UID.js": {
107
115
  "types": "./types/utils/UID.d.ts",
108
116
  "default": "./utils/UID.js"
@@ -1,7 +1,7 @@
1
1
  export class AppRouter {
2
2
  static appMap: {
3
3
  [x: string]: {
4
- title?: string;
4
+ title?: string | (() => string);
5
5
  default?: boolean;
6
6
  error?: boolean;
7
7
  pattern?: string;
@@ -9,7 +9,7 @@ export class AppRouter {
9
9
  __loaded?: boolean;
10
10
  };
11
11
  };
12
- static setDefaultTitle(title: string): void;
12
+ static setDefaultTitle(title: string | (() => string)): void;
13
13
  static setRoutingMap(map: {
14
14
  [x: string]: {};
15
15
  }): void;
@@ -41,7 +41,7 @@ export class AppRouter {
41
41
  static get separator(): string;
42
42
  static initRoutingCtx(ctxName: string, routingMap: {
43
43
  [x: string]: {
44
- title?: string;
44
+ title?: string | (() => string);
45
45
  default?: boolean;
46
46
  error?: boolean;
47
47
  pattern?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"AppRouter.d.ts","sourceRoot":"","sources":["../../core/AppRouter.js"],"names":[],"mappings":"AA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AS,aAAa,EAIjC;IApkBD,cA6BC;IArID,gCAEC;IAED,qBAAiB;IACjB,uBAAmB;IAiBnB,kBAHW,SAAS,gBAAgB,0BAmFnC;IApDG,aAAiD;IAyDnD,OADW,CAAC,CACoB;IAEhC;;MAAmC;IAEnC,oBADW,GAAG,CAAC,CAAC,EAAE,EAAE,gBAAgB,gBAAW,EAAE,KAAK,eAAU,KAAK,IAAI,CAAC,CACvC;IAEnC;;MAA8B;IAC9B,kBAAwB;IAExB,qBAAwB;IAExB,sBAAyB;IAEzB,wBAA0B;IAE1B,0BAA6B;IAI7B,iBAAoB;IAEpB,6BAAgC;IAEhC,mBAAsB;IAEtB,4BAA8B;IAIhC,yBAEC;IAGD,sBASC;IAGD,4BAKC;IAGD,6BAEC;IAuDD,IALuB,CAAC,SAAX,MAAO,CAAE,QACX,CAAC,WACD,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,wBAuC/B;IAGD,2BAIC;IAGD,uBAIC;IAQD,IALuB,CAAC,SAAX,MAAO,CAAE,qBAEX,CAAC,CAAC,CAAC,CAAC,2BAOd;IAMD,UAHW,OAAO,CAAC,CAAC,CAAC,2BAOpB;IAGD,SADc,CAAC,CA6Bd;IAMD,YAHW,OAAO,CAAC,CAAC,CAAC,mCAcpB;IAED,8BAgBC;IAdG,4CASE;IAmFF,0BAAwC;IAwB1C,uBAAyB;IAG3B,0BAEC;IAED,wBAAoB;IAUpB,yBAAuB;IACvB,6BA0BC;IA0CD,oEAeC;IAMD,yDAoBC;IAYD,0BAME;IAMF,0CAFW,GAAG,QAgBb;IAED,yBAGC;IAOD,8EAmBC;;CA+BF;;mBAruBkB,aAAa;qBAEX,iBAAiB;2BACX,iBAAiB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=devMessages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devMessages.d.ts","sourceRoot":"","sources":["../../core/devMessages.js"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../core/html.js"],"names":[],"mappings":"AAmBA,qBALa,CAAC,SACH,oBAAoB,YACpB,CAAC;QAAO,MAAM;CAAS,GAAG,cAAc,YAAY,CAAC,CAAC,EAAE,UAgClE;AA7CD,kCADW,QAAQ,CAOjB;;6BAEY,MAAM,CAAC,MAAM,qCAAgC,SAAS"}
1
+ {"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../core/html.js"],"names":[],"mappings":"AAoBA,qBALa,CAAC,SACH,oBAAoB,YACpB,CAAC;QAAO,MAAM;CAAS,GAAG,cAAc,YAAY,CAAC,CAAC,EAAE,UA6BlE;AA1CD,kCADW,QAAQ,CAOjB;;6BAEY,MAAM,CAAC,MAAM,qCAAgC,SAAS"}
@@ -1 +1 @@
1
- {"version":3,"file":"itemizeProcessor-keyed.d.ts","sourceRoot":"","sources":["../../core/itemizeProcessor-keyed.js"],"names":[],"mappings":"AA8BA,iCAJgD,CAAC,SAApC,qCAAkC,MACpC,gBAAgB,SAChB,CAAC,QAkLX"}
1
+ {"version":3,"file":"itemizeProcessor-keyed.d.ts","sourceRoot":"","sources":["../../core/itemizeProcessor-keyed.js"],"names":[],"mappings":"AA+BA,iCAJgD,CAAC,SAApC,qCAAkC,MACpC,gBAAgB,SAChB,CAAC,QAkLX"}
@@ -1 +1 @@
1
- {"version":3,"file":"itemizeProcessor.d.ts","sourceRoot":"","sources":["../../core/itemizeProcessor.js"],"names":[],"mappings":"AAQA,iCAJgD,CAAC,SAApC,qCAAkC,MACpC,gBAAgB,SAChB,CAAC,QAyDX"}
1
+ {"version":3,"file":"itemizeProcessor.d.ts","sourceRoot":"","sources":["../../core/itemizeProcessor.js"],"names":[],"mappings":"AASA,iCAJgD,CAAC,SAApC,qCAAkC,MACpC,gBAAgB,SAChB,CAAC,QAyDX"}
@@ -1 +1 @@
1
- {"version":3,"file":"tpl-processors.d.ts","sourceRoot":"","sources":["../../core/tpl-processors.js"],"names":[],"mappings":";0BA6HgD,CAAC,SAApC,qCAAkC,MACpC,gBAAgB,SAChB,CAAC;;iCA5HqB,uBAAuB"}
1
+ {"version":3,"file":"tpl-processors.d.ts","sourceRoot":"","sources":["../../core/tpl-processors.js"],"names":[],"mappings":";0BA2HgD,CAAC,SAApC,qCAAkC,MACpC,gBAAgB,SAChB,CAAC;;iCAzHqB,uBAAuB"}
@@ -0,0 +1,4 @@
1
+ export function warnMsg(code: number, ...args: any[]): void;
2
+ export function errMsg(code: number, ...args: any[]): void;
3
+ export function registerMessages(map: Map<number, (...args: any[]) => string>): void;
4
+ //# sourceMappingURL=warn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"warn.d.ts","sourceRoot":"","sources":["../../core/warn.js"],"names":[],"mappings":"AAOA,8BAHW,MAAM,WACF,GAAG,EAAA,QAKjB;AAMD,6BAHW,MAAM,WACF,GAAG,EAAA,QAKjB;AAGD,sCADY,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,CAAC,QAKlD"}