@bonsae/nrg 0.21.2 → 0.22.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 (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -3
  3. package/package.json +14 -9
  4. package/schemas/labels.schema.json +15 -5
  5. package/server/index.cjs +2 -1358
  6. package/test/client/component/index.js +41 -224
  7. package/test/client/component/setup.js +201 -1475
  8. package/test/client/e2e/config.js +12 -0
  9. package/test/client/e2e/index.js +419 -199
  10. package/test/client/unit/index.js +19 -32
  11. package/test/client/unit/setup.js +28 -21
  12. package/test/server/integration/index.js +2 -26
  13. package/test/server/unit/index.js +2 -184
  14. package/types/client.d.ts +1 -266
  15. package/types/server.d.ts +1 -900
  16. package/types/test-client-component.d.ts +7 -143
  17. package/types/test-client-e2e.d.ts +0 -6
  18. package/types/test-client-unit.d.ts +11 -105
  19. package/types/test-server-integration.d.ts +73 -49
  20. package/types/test-server-unit.d.ts +26 -2
  21. package/types/vite.d.ts +2 -0
  22. package/vite/index.js +378 -150
  23. package/server/resources/nrg-client.js +0 -7493
  24. package/test/client/component/nrg.css +0 -1
  25. package/types/shims/brands.d.ts +0 -32
  26. package/types/shims/client/form/components/node-red-config-input.vue.d.ts +0 -125
  27. package/types/shims/client/form/components/node-red-editor-input.vue.d.ts +0 -124
  28. package/types/shims/client/form/components/node-red-input-label.vue.d.ts +0 -34
  29. package/types/shims/client/form/components/node-red-input.vue.d.ts +0 -123
  30. package/types/shims/client/form/components/node-red-json-schema-form.vue.d.ts +0 -772
  31. package/types/shims/client/form/components/node-red-select-input.vue.d.ts +0 -132
  32. package/types/shims/client/form/components/node-red-toggle.vue.d.ts +0 -36
  33. package/types/shims/client/form/components/node-red-typed-input.vue.d.ts +0 -151
  34. package/types/shims/client/globals.d.ts +0 -320
  35. package/types/shims/client/types.d.ts +0 -227
  36. package/types/shims/components.d.ts +0 -23
  37. package/types/shims/constants.d.ts +0 -4
  38. package/types/shims/schema-options.d.ts +0 -24
  39. package/types/shims/shims-vue.d.ts +0 -5
  40. package/types/shims/typebox.d.ts +0 -10
@@ -1 +0,0 @@
1
- .nrg-label[data-v-864b02f2]{display:inline-block;width:100%;margin-bottom:4px;cursor:default}.nrg-label i[data-v-864b02f2]{margin-right:5px}.nrg-required[data-v-864b02f2]{color:var(--red-ui-text-color-error);margin-left:2px}.editor-wrapper[data-v-ea93e881]{position:relative}.expand-button[data-v-ea93e881]{position:absolute;top:-23px;right:0;z-index:10;transition:color .3s ease;cursor:pointer}.nrg-toggle-wrapper[data-v-724dcae4]{display:inline-flex;align-items:center}.nrg-toggle[data-v-724dcae4]{position:relative;display:inline-flex!important;flex-direction:column;align-items:flex-start;cursor:pointer;gap:4px;-webkit-user-select:none;user-select:none}.nrg-toggle__input[data-v-724dcae4]{position:absolute;opacity:0;width:0;height:0}.nrg-toggle__slider[data-v-724dcae4]{position:relative;display:inline-block;width:36px;min-width:36px;height:20px;background-color:var(--red-ui-secondary-border-color, #ccc);border-radius:10px;transition:background-color .2s ease}.nrg-toggle__slider[data-v-724dcae4]:after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;background-color:#fff;border-radius:50%;transition:transform .2s ease}.nrg-toggle--checked .nrg-toggle__slider[data-v-724dcae4]{background-color:var(--red-ui-text-color-link, #0070d2)}.nrg-toggle--checked .nrg-toggle__slider[data-v-724dcae4]:after{transform:translate(16px)}.nrg-toggle__label[data-v-724dcae4]{cursor:default;white-space:nowrap}.nrg-toggle__label i[data-v-724dcae4]{margin-right:2px}
@@ -1,32 +0,0 @@
1
- /**
2
- * Type-level contract shared by the server and client planes.
3
- *
4
- * `Static<>` of NRG's special schemas (NodeRef, TypedInput) produces these
5
- * brand shapes. Each plane maps them differently:
6
- *
7
- * - server `ResolvedStatic` (server/schemas/types): brand → runtime value
8
- * (NodeRef → the node instance, TypedInput → the resolving wrapper)
9
- * - client `EditorStatic` (client/types): brand → editor form value
10
- * (NodeRef → the referenced node id string, TypedInput → { value, type })
11
- *
12
- * Both planes import the brands from here, type-only, so renaming or
13
- * reshaping a brand is a compile error on both sides instead of silent
14
- * type drift. Keep this module free of runtime code and imports from
15
- * either plane.
16
- */
17
- /** Brand produced by `Static` of a NodeRef schema. */
18
- interface NodeRefResolved<T = any> {
19
- readonly __nrg_node_ref: true;
20
- readonly __instance: T;
21
- }
22
- /**
23
- * Structural shape of a resolved TypedInput (the server's TypedInput class
24
- * instance). The client matches this shape to map the field to its raw
25
- * editor value pair.
26
- */
27
- interface TypedInputResolved {
28
- resolve(...args: any[]): any;
29
- value: unknown;
30
- type: string;
31
- }
32
- export type { NodeRefResolved, TypedInputResolved };
@@ -1,125 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
- modelValue: {
3
- type: StringConstructor;
4
- default: undefined;
5
- };
6
- value: {
7
- type: StringConstructor;
8
- default: string;
9
- };
10
- type: {
11
- type: StringConstructor;
12
- required: true;
13
- };
14
- node: {
15
- type: () => NodeRED.BaseNode;
16
- required: true;
17
- };
18
- propName: {
19
- type: StringConstructor;
20
- required: true;
21
- };
22
- label: {
23
- type: StringConstructor;
24
- default: string;
25
- };
26
- icon: {
27
- type: StringConstructor;
28
- default: string;
29
- };
30
- required: {
31
- type: BooleanConstructor;
32
- default: boolean;
33
- };
34
- error: {
35
- type: StringConstructor;
36
- default: string;
37
- };
38
- }>, {
39
- jqInput: import("vue").ShallowRef<any, any>;
40
- }, {}, {
41
- inputId(): string;
42
- effectiveValue(): string;
43
- }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:value")[], "update:modelValue" | "update:value", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
44
- modelValue: {
45
- type: StringConstructor;
46
- default: undefined;
47
- };
48
- value: {
49
- type: StringConstructor;
50
- default: string;
51
- };
52
- type: {
53
- type: StringConstructor;
54
- required: true;
55
- };
56
- node: {
57
- type: () => NodeRED.BaseNode;
58
- required: true;
59
- };
60
- propName: {
61
- type: StringConstructor;
62
- required: true;
63
- };
64
- label: {
65
- type: StringConstructor;
66
- default: string;
67
- };
68
- icon: {
69
- type: StringConstructor;
70
- default: string;
71
- };
72
- required: {
73
- type: BooleanConstructor;
74
- default: boolean;
75
- };
76
- error: {
77
- type: StringConstructor;
78
- default: string;
79
- };
80
- }>> & Readonly<{
81
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
82
- "onUpdate:value"?: ((...args: any[]) => any) | undefined;
83
- }>, {
84
- label: string;
85
- icon: string;
86
- required: boolean;
87
- modelValue: string;
88
- value: string;
89
- error: string;
90
- }, {}, {
91
- NodeRedInputLabel: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
92
- label: {
93
- type: StringConstructor;
94
- default: string;
95
- };
96
- icon: {
97
- type: StringConstructor;
98
- default: string;
99
- };
100
- required: {
101
- type: BooleanConstructor;
102
- default: boolean;
103
- };
104
- }>, {}, {}, {
105
- iconClass(): string;
106
- }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
107
- label: {
108
- type: StringConstructor;
109
- default: string;
110
- };
111
- icon: {
112
- type: StringConstructor;
113
- default: string;
114
- };
115
- required: {
116
- type: BooleanConstructor;
117
- default: boolean;
118
- };
119
- }>> & Readonly<{}>, {
120
- label: string;
121
- icon: string;
122
- required: boolean;
123
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
124
- }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
125
- export default _default;
@@ -1,124 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
- modelValue: {
3
- type: StringConstructor;
4
- default: undefined;
5
- };
6
- value: {
7
- type: StringConstructor;
8
- default: string;
9
- };
10
- language: {
11
- type: StringConstructor;
12
- default: string;
13
- validator: (value: string) => boolean;
14
- };
15
- label: {
16
- type: StringConstructor;
17
- default: string;
18
- };
19
- icon: {
20
- type: StringConstructor;
21
- default: string;
22
- };
23
- required: {
24
- type: BooleanConstructor;
25
- default: boolean;
26
- };
27
- error: {
28
- type: StringConstructor;
29
- default: string;
30
- };
31
- }>, {
32
- editorInstance: import("vue").ShallowRef<any, any>;
33
- expandedEditorTray: import("vue").ShallowRef<any, any>;
34
- }, {
35
- editorId: string;
36
- stateId: string;
37
- trayElement: HTMLElement | null;
38
- }, {
39
- effectiveValue(): string;
40
- }, {
41
- mountEditor(): void;
42
- createEditorInstance(): void;
43
- createExpandeEditorTray(): void;
44
- onClickExpand(): void;
45
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:value" | "editor-ready" | "tray-open" | "tray-close")[], "update:modelValue" | "update:value" | "editor-ready" | "tray-open" | "tray-close", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
46
- modelValue: {
47
- type: StringConstructor;
48
- default: undefined;
49
- };
50
- value: {
51
- type: StringConstructor;
52
- default: string;
53
- };
54
- language: {
55
- type: StringConstructor;
56
- default: string;
57
- validator: (value: string) => boolean;
58
- };
59
- label: {
60
- type: StringConstructor;
61
- default: string;
62
- };
63
- icon: {
64
- type: StringConstructor;
65
- default: string;
66
- };
67
- required: {
68
- type: BooleanConstructor;
69
- default: boolean;
70
- };
71
- error: {
72
- type: StringConstructor;
73
- default: string;
74
- };
75
- }>> & Readonly<{
76
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
77
- "onUpdate:value"?: ((...args: any[]) => any) | undefined;
78
- "onEditor-ready"?: ((...args: any[]) => any) | undefined;
79
- "onTray-open"?: ((...args: any[]) => any) | undefined;
80
- "onTray-close"?: ((...args: any[]) => any) | undefined;
81
- }>, {
82
- label: string;
83
- icon: string;
84
- required: boolean;
85
- modelValue: string;
86
- value: string;
87
- error: string;
88
- language: string;
89
- }, {}, {
90
- NodeRedInputLabel: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
91
- label: {
92
- type: StringConstructor;
93
- default: string;
94
- };
95
- icon: {
96
- type: StringConstructor;
97
- default: string;
98
- };
99
- required: {
100
- type: BooleanConstructor;
101
- default: boolean;
102
- };
103
- }>, {}, {}, {
104
- iconClass(): string;
105
- }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
106
- label: {
107
- type: StringConstructor;
108
- default: string;
109
- };
110
- icon: {
111
- type: StringConstructor;
112
- default: string;
113
- };
114
- required: {
115
- type: BooleanConstructor;
116
- default: boolean;
117
- };
118
- }>> & Readonly<{}>, {
119
- label: string;
120
- icon: string;
121
- required: boolean;
122
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
123
- }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
124
- export default _default;
@@ -1,34 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
- label: {
3
- type: StringConstructor;
4
- default: string;
5
- };
6
- icon: {
7
- type: StringConstructor;
8
- default: string;
9
- };
10
- required: {
11
- type: BooleanConstructor;
12
- default: boolean;
13
- };
14
- }>, {}, {}, {
15
- iconClass(): string;
16
- }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
17
- label: {
18
- type: StringConstructor;
19
- default: string;
20
- };
21
- icon: {
22
- type: StringConstructor;
23
- default: string;
24
- };
25
- required: {
26
- type: BooleanConstructor;
27
- default: boolean;
28
- };
29
- }>> & Readonly<{}>, {
30
- label: string;
31
- icon: string;
32
- required: boolean;
33
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
34
- export default _default;
@@ -1,123 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
- modelValue: {
3
- type: (StringConstructor | NumberConstructor)[];
4
- default: undefined;
5
- };
6
- value: {
7
- type: (StringConstructor | NumberConstructor)[];
8
- default: string;
9
- };
10
- type: {
11
- type: StringConstructor;
12
- default: string;
13
- };
14
- placeholder: {
15
- type: StringConstructor;
16
- default: string;
17
- };
18
- label: {
19
- type: StringConstructor;
20
- default: string;
21
- };
22
- icon: {
23
- type: StringConstructor;
24
- default: string;
25
- };
26
- required: {
27
- type: BooleanConstructor;
28
- default: boolean;
29
- };
30
- error: {
31
- type: StringConstructor;
32
- default: string;
33
- };
34
- }>, {}, {
35
- internalValue: string;
36
- }, {
37
- effectiveValue(): string;
38
- }, {
39
- onInput(event: any): void;
40
- onFocus(): void;
41
- onBlur(): void;
42
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "update:modelValue" | "update:value")[], "input" | "update:modelValue" | "update:value", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
43
- modelValue: {
44
- type: (StringConstructor | NumberConstructor)[];
45
- default: undefined;
46
- };
47
- value: {
48
- type: (StringConstructor | NumberConstructor)[];
49
- default: string;
50
- };
51
- type: {
52
- type: StringConstructor;
53
- default: string;
54
- };
55
- placeholder: {
56
- type: StringConstructor;
57
- default: string;
58
- };
59
- label: {
60
- type: StringConstructor;
61
- default: string;
62
- };
63
- icon: {
64
- type: StringConstructor;
65
- default: string;
66
- };
67
- required: {
68
- type: BooleanConstructor;
69
- default: boolean;
70
- };
71
- error: {
72
- type: StringConstructor;
73
- default: string;
74
- };
75
- }>> & Readonly<{
76
- onInput?: ((...args: any[]) => any) | undefined;
77
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
78
- "onUpdate:value"?: ((...args: any[]) => any) | undefined;
79
- }>, {
80
- label: string;
81
- type: string;
82
- icon: string;
83
- required: boolean;
84
- modelValue: string | number;
85
- value: string | number;
86
- placeholder: string;
87
- error: string;
88
- }, {}, {
89
- NodeRedInputLabel: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
90
- label: {
91
- type: StringConstructor;
92
- default: string;
93
- };
94
- icon: {
95
- type: StringConstructor;
96
- default: string;
97
- };
98
- required: {
99
- type: BooleanConstructor;
100
- default: boolean;
101
- };
102
- }>, {}, {}, {
103
- iconClass(): string;
104
- }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
105
- label: {
106
- type: StringConstructor;
107
- default: string;
108
- };
109
- icon: {
110
- type: StringConstructor;
111
- default: string;
112
- };
113
- required: {
114
- type: BooleanConstructor;
115
- default: boolean;
116
- };
117
- }>> & Readonly<{}>, {
118
- label: string;
119
- icon: string;
120
- required: boolean;
121
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
122
- }, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
123
- export default _default;