@fluffjs/fluff 0.4.5 → 0.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.
Files changed (77) hide show
  1. package/bundle.min.js +1 -1
  2. package/decorators/Directive.d.ts +16 -0
  3. package/decorators/Directive.js +23 -0
  4. package/decorators/HostElement.d.ts +1 -0
  5. package/decorators/HostElement.js +4 -0
  6. package/index.d.ts +4 -0
  7. package/index.js +3 -0
  8. package/interfaces/ElementWithDirectives.d.ts +4 -0
  9. package/interfaces/FluffHostElement.d.ts +3 -10
  10. package/package.json +1 -1
  11. package/runtime/BreakController.d.ts +2 -3
  12. package/runtime/BreakController.js +0 -3
  13. package/runtime/FluffBase.d.ts +50 -42
  14. package/runtime/FluffBase.js +185 -242
  15. package/runtime/FluffDirective.d.ts +9 -0
  16. package/runtime/FluffDirective.js +36 -0
  17. package/runtime/FluffElement.d.ts +0 -1
  18. package/runtime/FluffElementImpl.d.ts +5 -10
  19. package/runtime/FluffElementImpl.js +59 -77
  20. package/runtime/FluffMarkers.d.ts +0 -1
  21. package/runtime/FluffMarkers.js +0 -1
  22. package/runtime/ForController.d.ts +2 -5
  23. package/runtime/ForController.js +7 -9
  24. package/runtime/IfController.d.ts +2 -5
  25. package/runtime/IfController.js +12 -13
  26. package/runtime/MarkerController.d.ts +9 -11
  27. package/runtime/MarkerController.js +6 -3
  28. package/runtime/MarkerManager.d.ts +2 -5
  29. package/runtime/MarkerManager.js +11 -50
  30. package/runtime/MarkerManagerInterface.d.ts +5 -2
  31. package/runtime/SwitchController.d.ts +2 -5
  32. package/runtime/SwitchController.js +10 -13
  33. package/runtime/TextController.d.ts +2 -4
  34. package/runtime/TextController.js +8 -16
  35. package/runtime/tests/DirectOutputParent.js +4 -1
  36. package/runtime/tests/TestChildTasksListComponent.js +4 -1
  37. package/runtime/tests/TestForComponent.js +4 -1
  38. package/runtime/tests/TestForReinsertBindsInputParentComponent.js +7 -2
  39. package/runtime/tests/TestForTextMarkerCollisionNoTrackParentComponent.js +5 -2
  40. package/runtime/tests/TestForTextMarkerCollisionParentComponent.js +5 -10
  41. package/runtime/tests/TestForUnsubscribeNestedParentComponent.js +7 -2
  42. package/runtime/tests/TestGetterReactivityComponent.js +4 -1
  43. package/runtime/tests/TestHarness.d.ts +1 -1
  44. package/runtime/tests/TestHarness.js +3 -3
  45. package/runtime/tests/TestIfReinsertBindsInputChildComponent.js +4 -1
  46. package/runtime/tests/TestIfReinsertBindsInputParentComponent.js +7 -2
  47. package/runtime/tests/TestIfUnsubscribeNestedParentComponent.js +7 -2
  48. package/runtime/tests/TestInterpolationNestedPropertyComponentBase.js +4 -1
  49. package/runtime/tests/TestLateDefineForComponent.js +4 -1
  50. package/runtime/tests/TestNullInputTextComponent.js +5 -2
  51. package/runtime/tests/TestOutputBindingChildComponent.js +4 -1
  52. package/runtime/tests/TestOutputBindingParentComponent.js +7 -2
  53. package/runtime/tests/TestParentBindsTasksComponent.js +4 -1
  54. package/runtime/tests/TestSwitchReinsertBindsInputChildComponent.js +4 -1
  55. package/runtime/tests/TestSwitchReinsertBindsInputParentComponent.js +8 -10
  56. package/runtime/tests/TestSwitchUnsubscribeNestedParentComponent.js +7 -9
  57. package/runtime/tests/TestTemplateNestedMarkersComponent.js +5 -2
  58. package/runtime/tests/TestUnsubscribeNestedChildComponent.js +4 -1
  59. package/runtime/tests/TestUnsubscribeNestedGrandchildComponent.js +4 -1
  60. package/runtime/tests/createPipeUnwrapTestComponent.js +4 -1
  61. package/runtime/tests/createPropBindParentComponent.js +4 -1
  62. package/runtime/tests/createTestInterpolationPipeComponent.js +4 -1
  63. package/runtime/tests/createTestInterpolationPipeWithArgsComponent.js +4 -1
  64. package/interfaces/BreakMarkerConfig.d.ts +0 -3
  65. package/interfaces/ForMarkerConfig.d.ts +0 -8
  66. package/interfaces/ForMarkerConfig.js +0 -1
  67. package/interfaces/IfMarkerConfig.d.ts +0 -7
  68. package/interfaces/IfMarkerConfig.js +0 -1
  69. package/interfaces/MarkerConfig.d.ts +0 -6
  70. package/interfaces/MarkerConfig.js +0 -1
  71. package/interfaces/SwitchMarkerConfig.d.ts +0 -10
  72. package/interfaces/SwitchMarkerConfig.js +0 -1
  73. package/interfaces/TextMarkerConfig.d.ts +0 -9
  74. package/interfaces/TextMarkerConfig.js +0 -1
  75. package/runtime/MarkerConfigGuards.d.ts +0 -13
  76. package/runtime/MarkerConfigGuards.js +0 -17
  77. /package/interfaces/{BreakMarkerConfig.js → ElementWithDirectives.js} +0 -0
@@ -1,9 +1,7 @@
1
- import type { TextMarkerConfig } from '../interfaces/TextMarkerConfig.js';
1
+ import { type CompactTextConfig } from './FluffBase.js';
2
2
  import { MarkerController } from './MarkerController.js';
3
- export declare class TextController extends MarkerController {
4
- private readonly config;
3
+ export declare class TextController extends MarkerController<CompactTextConfig> {
5
4
  private textNode;
6
- constructor(id: number, startMarker: Comment, endMarker: Comment | null, host: HTMLElement, shadowRoot: ShadowRoot, config: TextMarkerConfig);
7
5
  initialize(): void;
8
6
  private formatValue;
9
7
  }
@@ -1,18 +1,16 @@
1
+ import { FluffBase } from './FluffBase.js';
1
2
  import { MarkerController } from './MarkerController.js';
2
3
  export class TextController extends MarkerController {
3
- config;
4
4
  textNode = null;
5
- constructor(id, startMarker, endMarker, host, shadowRoot, config) {
6
- super(id, startMarker, endMarker, host, shadowRoot);
7
- this.config = config;
8
- }
9
5
  initialize() {
10
6
  this.textNode = document.createTextNode('');
11
7
  this.insertBeforeEndMarker(this.textNode);
12
- const deps = this.config.deps ?? [];
13
- const pipes = this.config.pipes ?? [];
8
+ // CompactTextConfig: [2, exprId, deps, pipes] — pipes = [pipeNameIdx, argExprIds[]][]
9
+ const [, exprId, compactDeps, compactPipes] = this.config;
10
+ const deps = FluffBase.__decodeDeps(compactDeps) ?? [];
11
+ const pipes = compactPipes ?? [];
14
12
  const update = () => {
15
- let result = this.evaluateExpr(this.config.exprId);
13
+ let result = this.evaluateExpr(exprId);
16
14
  if (this.host.__applyPipesForController) {
17
15
  const scope = this.getScope();
18
16
  const allLocals = this.collectLocalsFromScope(scope);
@@ -25,18 +23,12 @@ export class TextController extends MarkerController {
25
23
  this.subscribeAndRun(deps, update);
26
24
  }
27
25
  formatValue(result) {
28
- if (result === null || result === undefined) {
29
- return '';
30
- }
31
- if (typeof result === 'object') {
32
- return JSON.stringify(result);
33
- }
34
26
  if (typeof result === 'string') {
35
27
  return result;
36
28
  }
37
- if (typeof result === 'number' || typeof result === 'boolean') {
29
+ if (typeof result === 'number' || typeof result === 'boolean' || typeof result === 'bigint') {
38
30
  return String(result);
39
31
  }
40
- return '';
32
+ return JSON.stringify(result);
41
33
  }
42
34
  }
@@ -1,3 +1,4 @@
1
+ import { FluffBase } from '../FluffBase.js';
1
2
  import { FluffElement } from '../FluffElementImpl.js';
2
3
  export class DirectOutputParent extends FluffElement {
3
4
  receivedValue = null;
@@ -6,8 +7,10 @@ export class DirectOutputParent extends FluffElement {
6
7
  }
7
8
  __render() {
8
9
  this.__getShadowRoot().innerHTML = '<direct-output-child x-fluff-component data-lid="l0"></direct-output-child>';
10
+ const si = FluffBase.__s.length;
11
+ FluffBase.__s.push('submit');
9
12
  const bindings = {
10
- l0: [{ n: 'submit', b: 'event', h: 0, d: ['onSubmit'] }]
13
+ l0: [[si, 1, null, 0]]
11
14
  };
12
15
  Reflect.set(this.constructor, '__bindings', bindings);
13
16
  }
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElement.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  export class TestChildTasksListComponent extends FluffElement {
@@ -17,8 +18,10 @@ export class TestChildTasksListComponent extends FluffElement {
17
18
  <div class="item"></div>
18
19
  </template>
19
20
  `;
21
+ const si = FluffBase.__s.length;
22
+ FluffBase.__s.push('task', 'tasks');
20
23
  this.__setMarkerConfigs([
21
- [0, { type: 'for', iterator: 'task', iterableExprId: 2, deps: ['tasks'], hasEmpty: false }]
24
+ [0, [1, si, 2, false, [si + 1], null]]
22
25
  ]);
23
26
  }
24
27
  __setupBindings() {
@@ -1,3 +1,4 @@
1
+ import { FluffBase } from '../FluffBase.js';
1
2
  import { FluffElement } from '../FluffElement.js';
2
3
  import { MarkerManager } from '../MarkerManager.js';
3
4
  export class TestForComponent extends FluffElement {
@@ -10,8 +11,10 @@ export class TestForComponent extends FluffElement {
10
11
  <test-for-child data-lid="l0"></test-for-child>
11
12
  </template>
12
13
  `;
14
+ const si = FluffBase.__s.length;
15
+ FluffBase.__s.push('item', 'items');
13
16
  this.__setMarkerConfigs([
14
- [0, { type: 'for', iterator: 'item', iterableExprId: 0, deps: ['items'], hasEmpty: false }]
17
+ [0, [1, si, 0, false, [si + 1], null]]
15
18
  ]);
16
19
  }
17
20
  __setupBindings() {
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElementImpl.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  export class TestForReinsertBindsInputParentComponent extends FluffElement {
@@ -42,11 +43,15 @@ export class TestForReinsertBindsInputParentComponent extends FluffElement {
42
43
  <div class="empty">empty</div>
43
44
  </template>
44
45
  `;
46
+ const si = FluffBase.__s.length;
47
+ FluffBase.__s.push('item', 'items');
45
48
  this.__setMarkerConfigs([
46
- [0, { type: 'for', iterator: 'item', iterableExprId: 0, deps: ['items'], hasEmpty: true }]
49
+ [0, [1, si, 0, true, [si + 1], null]]
47
50
  ]);
51
+ const bi = FluffBase.__s.length;
52
+ FluffBase.__s.push('stats');
48
53
  const bindings = {
49
- l0: [{ n: 'stats', b: 'property', e: 1, d: ['stats'] }]
54
+ l0: [[bi, 0, [bi], 1]]
50
55
  };
51
56
  Reflect.set(this.constructor, '__bindings', bindings);
52
57
  }
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElementImpl.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  export class TestForTextMarkerCollisionNoTrackParentComponent extends FluffElement {
@@ -17,9 +18,11 @@ export class TestForTextMarkerCollisionNoTrackParentComponent extends FluffEleme
17
18
  <span class="tag"><!--fluff:text:9--><!--/fluff:text:9--></span>
18
19
  </template>
19
20
  `;
21
+ const si = FluffBase.__s.length;
22
+ FluffBase.__s.push('tag', 'tags');
20
23
  this.__setMarkerConfigs([
21
- [0, { type: 'for', iterator: 'tag', iterableExprId: 0, deps: ['tags'], hasEmpty: false }],
22
- [9, { type: 'text', exprId: 1, deps: ['tag'] }]
24
+ [0, [1, si, 0, false, [si + 1], null]],
25
+ [9, [2, 1, [si], null]]
23
26
  ]);
24
27
  }
25
28
  __setupBindings() {
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElementImpl.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  export class TestForTextMarkerCollisionParentComponent extends FluffElement {
@@ -28,17 +29,11 @@ export class TestForTextMarkerCollisionParentComponent extends FluffElement {
28
29
  <span class="tag"><!--fluff:text:9--><!--/fluff:text:9--></span>
29
30
  </template>
30
31
  `;
32
+ const si = FluffBase.__s.length;
33
+ FluffBase.__s.push('tag', 'tags', 'lowercase', 'capitalize');
31
34
  this.__setMarkerConfigs([
32
- [0, { type: 'for', iterator: 'tag', iterableExprId: 0, deps: ['tags'], trackBy: 'tag', hasEmpty: false }],
33
- [
34
- 9,
35
- {
36
- type: 'text',
37
- exprId: 1,
38
- deps: ['tag'],
39
- pipes: [{ name: 'lowercase', argExprIds: [] }, { name: 'capitalize', argExprIds: [] }]
40
- }
41
- ]
35
+ [0, [1, si, 0, false, [si + 1], si]],
36
+ [9, [2, 1, [si], [[si + 2, []], [si + 3, []]]]]
42
37
  ]);
43
38
  }
44
39
  __setupBindings() {
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { MarkerManager } from '../MarkerManager.js';
3
4
  import { TestUnsubscribeNestedParentBaseComponent } from './TestUnsubscribeNestedParentBaseComponent.js';
4
5
  export class TestForUnsubscribeNestedParentComponent extends TestUnsubscribeNestedParentBaseComponent {
@@ -20,11 +21,15 @@ export class TestForUnsubscribeNestedParentComponent extends TestUnsubscribeNest
20
21
  <div class="empty">empty</div>
21
22
  </template>
22
23
  `;
24
+ const si = FluffBase.__s.length;
25
+ FluffBase.__s.push('item', 'items');
23
26
  this.__setMarkerConfigs([
24
- [0, { type: 'for', iterator: 'item', iterableExprId: 0, deps: ['items'], hasEmpty: true }]
27
+ [0, [1, si, 0, true, [si + 1], null]]
25
28
  ]);
29
+ const bi = FluffBase.__s.length;
30
+ FluffBase.__s.push('stats');
26
31
  const bindings = {
27
- l0: [{ n: 'stats', b: 'property', e: 1, d: ['stats'] }]
32
+ l0: [[bi, 0, [bi], 1]]
28
33
  };
29
34
  Reflect.set(this.constructor, '__bindings', bindings);
30
35
  }
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElement.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  export class TestGetterReactivityComponent extends FluffElement {
@@ -16,8 +17,10 @@ export class TestGetterReactivityComponent extends FluffElement {
16
17
  this.__getShadowRoot().innerHTML = `
17
18
  <div class="count"><!--fluff:text:0--><!--/fluff:text:0--></div>
18
19
  `;
20
+ const si = FluffBase.__s.length;
21
+ FluffBase.__s.push('items');
19
22
  this.__setMarkerConfigs([
20
- [0, { type: 'text', exprId: 0, deps: ['items'], pipes: [] }]
23
+ [0, [2, 0, [si], null]]
21
24
  ]);
22
25
  }
23
26
  __setupBindings() {
@@ -1,6 +1,6 @@
1
1
  import { type ExpressionFn, type HandlerFn } from '../FluffBase.js';
2
2
  export declare class TestHarness {
3
- static setExpressionTable(expressions: ExpressionFn[], handlers: HandlerFn[]): void;
3
+ static setExpressionTable(expressions: ExpressionFn[], handlers: HandlerFn[], strings?: string[]): void;
4
4
  static resetExpressionTable(): void;
5
5
  static defineCustomElement(tag: string, ctor: CustomElementConstructor): void;
6
6
  static mount(tag: string): HTMLElement;
@@ -1,10 +1,10 @@
1
1
  import { FluffBase } from '../FluffBase.js';
2
2
  export class TestHarness {
3
- static setExpressionTable(expressions, handlers) {
4
- FluffBase.__setExpressionTable(expressions, handlers);
3
+ static setExpressionTable(expressions, handlers, strings) {
4
+ FluffBase.__setExpressionTable(expressions, handlers, strings);
5
5
  }
6
6
  static resetExpressionTable() {
7
- FluffBase.__setExpressionTable([], []);
7
+ FluffBase.__setExpressionTable([], [], []);
8
8
  }
9
9
  static defineCustomElement(tag, ctor) {
10
10
  if (!customElements.get(tag)) {
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElementImpl.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  export class TestIfReinsertBindsInputChildComponent extends FluffElement {
@@ -28,8 +29,10 @@ export class TestIfReinsertBindsInputChildComponent extends FluffElement {
28
29
  this.__getShadowRoot().innerHTML = `
29
30
  <div class="total"><!--fluff:text:0--><!--/fluff:text:0--></div>
30
31
  `;
32
+ const si = FluffBase.__s.length;
33
+ FluffBase.__s.push('stats');
31
34
  this.__setMarkerConfigs([
32
- [0, { type: 'text', exprId: 2, deps: ['stats'], pipes: [] }]
35
+ [0, [2, 2, [si], null]]
33
36
  ]);
34
37
  }
35
38
  __setupBindings() {
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElementImpl.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  export class TestIfReinsertBindsInputParentComponent extends FluffElement {
@@ -39,11 +40,15 @@ export class TestIfReinsertBindsInputParentComponent extends FluffElement {
39
40
  <test-if-reinsert-binds-input-child x-fluff-component data-lid="l0"></test-if-reinsert-binds-input-child>
40
41
  </template>
41
42
  `;
43
+ const si = FluffBase.__s.length;
44
+ FluffBase.__s.push('show');
42
45
  this.__setMarkerConfigs([
43
- [0, { type: 'if', branches: [{ exprId: 0, deps: ['show'] }] }]
46
+ [0, [0, [[0, [si]]]]]
44
47
  ]);
48
+ const bi = FluffBase.__s.length;
49
+ FluffBase.__s.push('stats');
45
50
  const bindings = {
46
- l0: [{ n: 'stats', b: 'property', e: 1, d: ['stats'] }]
51
+ l0: [[bi, 0, [bi], 1]]
47
52
  };
48
53
  Reflect.set(this.constructor, '__bindings', bindings);
49
54
  }
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { MarkerManager } from '../MarkerManager.js';
3
4
  import { TestUnsubscribeNestedParentBaseComponent } from './TestUnsubscribeNestedParentBaseComponent.js';
4
5
  export class TestIfUnsubscribeNestedParentComponent extends TestUnsubscribeNestedParentBaseComponent {
@@ -17,11 +18,15 @@ export class TestIfUnsubscribeNestedParentComponent extends TestUnsubscribeNeste
17
18
  <test-unsubscribe-nested-child x-fluff-component data-lid="l0"></test-unsubscribe-nested-child>
18
19
  </template>
19
20
  `;
21
+ const si = FluffBase.__s.length;
22
+ FluffBase.__s.push('show');
20
23
  this.__setMarkerConfigs([
21
- [0, { type: 'if', branches: [{ exprId: 0, deps: ['show'] }] }]
24
+ [0, [0, [[0, [si]]]]]
22
25
  ]);
26
+ const bi = FluffBase.__s.length;
27
+ FluffBase.__s.push('stats');
23
28
  const bindings = {
24
- l0: [{ n: 'stats', b: 'property', e: 1, d: ['stats'] }]
29
+ l0: [[bi, 0, [bi], 1]]
25
30
  };
26
31
  Reflect.set(this.constructor, '__bindings', bindings);
27
32
  }
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElement.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  import { TestInterpolationNestedPropertyContainerClass } from './TestInterpolationNestedPropertyContainerClass.js';
@@ -19,8 +20,10 @@ export class TestInterpolationNestedPropertyComponentBase extends FluffElement {
19
20
  }
20
21
  __render() {
21
22
  this.__getShadowRoot().innerHTML = '<!--fluff:text:0--><!--/fluff:text:0-->';
23
+ const si = FluffBase.__s.length;
24
+ FluffBase.__s.push('hostClass', 'childProp');
22
25
  this.__setMarkerConfigs([
23
- [0, { type: 'text', exprId: 0, deps: [['hostClass', 'childProp']], pipes: [] }]
26
+ [0, [2, 0, [[si, si + 1]], null]]
24
27
  ]);
25
28
  }
26
29
  __setupBindings() {
@@ -1,3 +1,4 @@
1
+ import { FluffBase } from '../FluffBase.js';
1
2
  import { FluffElement } from '../FluffElement.js';
2
3
  import { MarkerManager } from '../MarkerManager.js';
3
4
  export class TestLateDefineForComponent extends FluffElement {
@@ -14,8 +15,10 @@ export class TestLateDefineForComponent extends FluffElement {
14
15
  <late-define-for-child x-fluff-component="" data-lid="l0"></late-define-for-child>
15
16
  </template>
16
17
  `;
18
+ const si = FluffBase.__s.length;
19
+ FluffBase.__s.push('column', 'columns');
17
20
  this.__setMarkerConfigs([
18
- [0, { type: 'for', iterator: 'column', iterableExprId: 0, deps: ['columns'], hasEmpty: false }]
21
+ [0, [1, si, 0, false, [si + 1], null]]
19
22
  ]);
20
23
  }
21
24
  __setupBindings() {
@@ -1,4 +1,5 @@
1
1
  import { Property as PropertyImpl } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElement.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  export class TestNullInputTextComponent extends FluffElement {
@@ -25,9 +26,11 @@ export class TestNullInputTextComponent extends FluffElement {
25
26
  </template>
26
27
  <template data-fluff-branch="test-null-input-text-0-1"></template>
27
28
  `;
29
+ const si = FluffBase.__s.length;
30
+ FluffBase.__s.push('isEditing', 'task');
28
31
  this.__setMarkerConfigs([
29
- [0, { type: 'if', branches: [{ exprId: 0, deps: ['isEditing'] }, { exprId: undefined, deps: [] }] }],
30
- [1, { type: 'text', exprId: 1, deps: ['task'], pipes: [] }]
32
+ [0, [0, [[0, [si]], []]]],
33
+ [1, [2, 1, [si + 1], null]]
31
34
  ]);
32
35
  }
33
36
  __setupBindings() {
@@ -1,4 +1,5 @@
1
1
  import { Publisher } from '../../utils/Publisher.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElementImpl.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  export class TestOutputBindingChildComponent extends FluffElement {
@@ -8,8 +9,10 @@ export class TestOutputBindingChildComponent extends FluffElement {
8
9
  }
9
10
  __render() {
10
11
  this.__getShadowRoot().innerHTML = '<button data-lid="l0">Edit</button>';
12
+ const bi = FluffBase.__s.length;
13
+ FluffBase.__s.push('click');
11
14
  const bindings = {
12
- l0: [{ n: 'click', b: 'event', h: 1, d: ['onEdit'] }]
15
+ l0: [[bi, 1, null, 1]]
13
16
  };
14
17
  Reflect.set(this.constructor, '__bindings', bindings);
15
18
  }
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElementImpl.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  export class TestOutputBindingParentComponent extends FluffElement {
@@ -23,11 +24,15 @@ export class TestOutputBindingParentComponent extends FluffElement {
23
24
  <test-output-binding-child x-fluff-component data-lid="l0"></test-output-binding-child>
24
25
  </template>
25
26
  `;
27
+ const si = FluffBase.__s.length;
28
+ FluffBase.__s.push('show');
26
29
  this.__setMarkerConfigs([
27
- [0, { type: 'if', branches: [{ exprId: 0, deps: ['show'] }] }]
30
+ [0, [0, [[0, [si]]]]]
28
31
  ]);
32
+ const bi = FluffBase.__s.length;
33
+ FluffBase.__s.push('edit');
29
34
  const bindings = {
30
- l0: [{ n: 'edit', b: 'event', h: 0, d: ['onChildEdit'] }]
35
+ l0: [[bi, 1, null, 0]]
31
36
  };
32
37
  Reflect.set(this.constructor, '__bindings', bindings);
33
38
  }
@@ -1,3 +1,4 @@
1
+ import { FluffBase } from '../FluffBase.js';
1
2
  import { FluffElement } from '../FluffElement.js';
2
3
  import { MarkerManager } from '../MarkerManager.js';
3
4
  export class TestParentBindsTasksComponent extends FluffElement {
@@ -11,8 +12,10 @@ export class TestParentBindsTasksComponent extends FluffElement {
11
12
  <test-child-tasks-list x-fluff-component="" data-lid="l0"></test-child-tasks-list>
12
13
  </template>
13
14
  `;
15
+ const si = FluffBase.__s.length;
16
+ FluffBase.__s.push('child', 'childList');
14
17
  this.__setMarkerConfigs([
15
- [0, { type: 'for', iterator: 'child', iterableExprId: 0, deps: ['childList'], hasEmpty: false }]
18
+ [0, [1, si, 0, false, [si + 1], null]]
16
19
  ]);
17
20
  }
18
21
  __setupBindings() {
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElementImpl.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  export class TestSwitchReinsertBindsInputChildComponent extends FluffElement {
@@ -28,8 +29,10 @@ export class TestSwitchReinsertBindsInputChildComponent extends FluffElement {
28
29
  this.__getShadowRoot().innerHTML = `
29
30
  <div class="total"><!--fluff:text:0--><!--/fluff:text:0--></div>
30
31
  `;
32
+ const si = FluffBase.__s.length;
33
+ FluffBase.__s.push('stats');
31
34
  this.__setMarkerConfigs([
32
- [0, { type: 'text', exprId: 4, deps: ['stats'], pipes: [] }]
35
+ [0, [2, 4, [si], null]]
33
36
  ]);
34
37
  }
35
38
  __setupBindings() {
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElementImpl.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  export class TestSwitchReinsertBindsInputParentComponent extends FluffElement {
@@ -42,19 +43,16 @@ export class TestSwitchReinsertBindsInputParentComponent extends FluffElement {
42
43
  <test-switch-reinsert-binds-input-child x-fluff-component data-lid="l1"></test-switch-reinsert-binds-input-child>
43
44
  </template>
44
45
  `;
46
+ const si = FluffBase.__s.length;
47
+ FluffBase.__s.push('mode');
45
48
  this.__setMarkerConfigs([
46
- [
47
- 0, {
48
- type: 'switch', expressionExprId: 0, deps: ['mode'], cases: [
49
- { valueExprId: 1, isDefault: false, fallthrough: false },
50
- { valueExprId: 2, isDefault: false, fallthrough: false }
51
- ]
52
- }
53
- ]
49
+ [0, [3, 0, [si], [[false, false, 1], [false, false, 2]]]]
54
50
  ]);
51
+ const bi = FluffBase.__s.length;
52
+ FluffBase.__s.push('stats');
55
53
  const bindings = {
56
- l0: [{ n: 'stats', b: 'property', e: 3, d: ['stats'] }],
57
- l1: [{ n: 'stats', b: 'property', e: 3, d: ['stats'] }]
54
+ l0: [[bi, 0, [bi], 3]],
55
+ l1: [[bi, 0, [bi], 3]]
58
56
  };
59
57
  Reflect.set(this.constructor, '__bindings', bindings);
60
58
  }
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { MarkerManager } from '../MarkerManager.js';
3
4
  import { TestUnsubscribeNestedParentBaseComponent } from './TestUnsubscribeNestedParentBaseComponent.js';
4
5
  export class TestSwitchUnsubscribeNestedParentComponent extends TestUnsubscribeNestedParentBaseComponent {
@@ -20,18 +21,15 @@ export class TestSwitchUnsubscribeNestedParentComponent extends TestUnsubscribeN
20
21
  <div class="placeholder">placeholder</div>
21
22
  </template>
22
23
  `;
24
+ const si = FluffBase.__s.length;
25
+ FluffBase.__s.push('mode');
23
26
  this.__setMarkerConfigs([
24
- [
25
- 0, {
26
- type: 'switch', expressionExprId: 0, deps: ['mode'], cases: [
27
- { valueExprId: 1, isDefault: false, fallthrough: false },
28
- { valueExprId: 2, isDefault: false, fallthrough: false }
29
- ]
30
- }
31
- ]
27
+ [0, [3, 0, [si], [[false, false, 1], [false, false, 2]]]]
32
28
  ]);
29
+ const bi = FluffBase.__s.length;
30
+ FluffBase.__s.push('stats');
33
31
  const bindings = {
34
- l0: [{ n: 'stats', b: 'property', e: 3, d: ['stats'] }]
32
+ l0: [[bi, 0, [bi], 3]]
35
33
  };
36
34
  Reflect.set(this.constructor, '__bindings', bindings);
37
35
  }
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElement.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  export class TestTemplateNestedMarkersComponent extends FluffElement {
@@ -27,9 +28,11 @@ export class TestTemplateNestedMarkersComponent extends FluffElement {
27
28
  <div class="fallback">Fallback</div>
28
29
  </template>
29
30
  `;
31
+ const si = FluffBase.__s.length;
32
+ FluffBase.__s.push('show', 'text');
30
33
  this.__setMarkerConfigs([
31
- [0, { type: 'if', branches: [{ exprId: 0, deps: ['show'] }, { exprId: undefined, deps: [] }] }],
32
- [1, { type: 'text', exprId: 1, deps: ['text'], pipes: [] }]
34
+ [0, [0, [[0, [si]], []]]],
35
+ [1, [2, 1, [si + 1], null]]
33
36
  ]);
34
37
  }
35
38
  __setupBindings() {
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElementImpl.js';
3
4
  export class TestUnsubscribeNestedChildComponent extends FluffElement {
4
5
  __stats = new Property({
@@ -32,8 +33,10 @@ export class TestUnsubscribeNestedChildComponent extends FluffElement {
32
33
  this.__getShadowRoot().innerHTML = `
33
34
  <test-unsubscribe-nested-grandchild x-fluff-component data-lid="l0"></test-unsubscribe-nested-grandchild>
34
35
  `;
36
+ const bi = FluffBase.__s.length;
37
+ FluffBase.__s.push('stats');
35
38
  const bindings = {
36
- l0: [{ n: 'stats', b: 'property', e: 4, d: ['stats'] }]
39
+ l0: [[bi, 0, [bi], 4]]
37
40
  };
38
41
  Reflect.set(this.constructor, '__bindings', bindings);
39
42
  }
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElementImpl.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  export class TestUnsubscribeNestedGrandchildComponent extends FluffElement {
@@ -28,8 +29,10 @@ export class TestUnsubscribeNestedGrandchildComponent extends FluffElement {
28
29
  this.__getShadowRoot().innerHTML = `
29
30
  <div class="total"><!--fluff:text:0--><!--/fluff:text:0--></div>
30
31
  `;
32
+ const si = FluffBase.__s.length;
33
+ FluffBase.__s.push('stats');
31
34
  this.__setMarkerConfigs([
32
- [0, { type: 'text', exprId: 5, deps: ['stats'], pipes: [] }]
35
+ [0, [2, 5, [si], null]]
33
36
  ]);
34
37
  }
35
38
  __setupBindings() {
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElementImpl.js';
3
4
  import { MarkerManager } from '../MarkerManager.js';
4
5
  export function createPipeUnwrapTestComponent(state) {
@@ -19,8 +20,10 @@ export function createPipeUnwrapTestComponent(state) {
19
20
  };
20
21
  __render() {
21
22
  this.__getShadowRoot().innerHTML = '<span><!--fluff:text:0--><!--/fluff:text:0--></span>';
23
+ const si = FluffBase.__s.length;
24
+ FluffBase.__s.push('testProp', 'capture');
22
25
  this.__setMarkerConfigs([
23
- [0, { type: 'text', exprId: 0, deps: ['testProp'], pipes: [{ name: 'capture', argExprIds: [] }] }]
26
+ [0, [2, 0, [si], [[si + 1, []]]]]
24
27
  ]);
25
28
  }
26
29
  __setupBindings() {
@@ -1,4 +1,5 @@
1
1
  import { Property } from '../../utils/Property.js';
2
+ import { FluffBase } from '../FluffBase.js';
2
3
  import { FluffElement } from '../FluffElementImpl.js';
3
4
  export function createPropBindParentComponent(childTag) {
4
5
  class ParentComponent extends FluffElement {
@@ -12,8 +13,10 @@ export function createPropBindParentComponent(childTag) {
12
13
  super.__setupBindings();
13
14
  }
14
15
  }
16
+ const bi = FluffBase.__s.length;
17
+ FluffBase.__s.push('theProp');
15
18
  ParentComponent.__bindings = {
16
- l0: [{ n: 'theProp', b: 'property', e: 0, d: [] }]
19
+ l0: [[bi, 0, null, 0]]
17
20
  };
18
21
  return ParentComponent;
19
22
  }