@ethereal-nexus/core 0.3.4 → 1.0.1
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/LICENSE.md +201 -0
- package/dist/decorators/index.d.mts +1 -1
- package/dist/decorators/index.d.ts +1 -1
- package/dist/decorators/webcomponent/index.d.mts +1 -1
- package/dist/decorators/webcomponent/index.d.ts +1 -1
- package/dist/decorators/webcomponent/webcomponent.d.mts +1 -1
- package/dist/decorators/webcomponent/webcomponent.d.ts +1 -1
- package/dist/functions/component/component.d.mts +1 -1
- package/dist/functions/component/component.d.ts +1 -1
- package/dist/functions/component/index.d.mts +1 -1
- package/dist/functions/component/index.d.ts +1 -1
- package/dist/functions/index.d.mts +1 -1
- package/dist/functions/index.d.ts +1 -1
- package/dist/functions/parse/index.d.mts +1 -1
- package/dist/functions/parse/index.d.ts +1 -1
- package/dist/functions/parse/parse.d.mts +1 -1
- package/dist/functions/parse/parse.d.ts +1 -1
- package/dist/functions/parse/parsePrimitives.d.mts +1 -1
- package/dist/functions/parse/parsePrimitives.d.ts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -1
- package/dist/schema/calendar/calendar.d.mts +1 -1
- package/dist/schema/calendar/calendar.d.ts +1 -1
- package/dist/schema/calendar/index.d.mts +1 -1
- package/dist/schema/calendar/index.d.ts +1 -1
- package/dist/schema/checkbox/checkbox.d.mts +1 -1
- package/dist/schema/checkbox/checkbox.d.ts +1 -1
- package/dist/schema/checkbox/index.d.mts +1 -1
- package/dist/schema/checkbox/index.d.ts +1 -1
- package/dist/schema/datamodel/datamodel.d.mts +1 -1
- package/dist/schema/datamodel/datamodel.d.ts +1 -1
- package/dist/schema/datamodel/index.d.mts +1 -1
- package/dist/schema/datamodel/index.d.ts +1 -1
- package/dist/schema/datasource/datasource.d.mts +1 -1
- package/dist/schema/datasource/datasource.d.ts +1 -1
- package/dist/schema/datasource/index.d.mts +1 -1
- package/dist/schema/datasource/index.d.ts +1 -1
- package/dist/schema/dialog/condition.d.mts +1 -1
- package/dist/schema/dialog/condition.d.ts +1 -1
- package/dist/schema/dialog/condition.js +5 -0
- package/dist/schema/dialog/condition.js.map +1 -1
- package/dist/schema/dialog/condition.mjs +5 -0
- package/dist/schema/dialog/condition.mjs.map +1 -1
- package/dist/schema/dialog/dialog.d.mts +1 -1
- package/dist/schema/dialog/dialog.d.ts +1 -1
- package/dist/schema/dialog/dialog.js +5 -0
- package/dist/schema/dialog/dialog.js.map +1 -1
- package/dist/schema/dialog/dialog.mjs +5 -0
- package/dist/schema/dialog/dialog.mjs.map +1 -1
- package/dist/schema/dialog/index.d.mts +1 -1
- package/dist/schema/dialog/index.d.ts +1 -1
- package/dist/schema/dialog/index.js +5 -0
- package/dist/schema/dialog/index.js.map +1 -1
- package/dist/schema/dialog/index.mjs +5 -0
- package/dist/schema/dialog/index.mjs.map +1 -1
- package/dist/schema/dialog/tabs.d.mts +1 -1
- package/dist/schema/dialog/tabs.d.ts +1 -1
- package/dist/schema/dialog/types.d.mts +1 -1
- package/dist/schema/dialog/types.d.ts +1 -1
- package/dist/schema/dialog/types.js.map +1 -1
- package/dist/schema/dynamic/dynamic.d.mts +1 -1
- package/dist/schema/dynamic/dynamic.d.ts +1 -1
- package/dist/schema/dynamic/index.d.mts +1 -1
- package/dist/schema/dynamic/index.d.ts +1 -1
- package/dist/schema/group/group.d.mts +1 -1
- package/dist/schema/group/group.d.ts +1 -1
- package/dist/schema/group/index.d.mts +1 -1
- package/dist/schema/group/index.d.ts +1 -1
- package/dist/schema/hidden/hidden.d.mts +1 -1
- package/dist/schema/hidden/hidden.d.ts +1 -1
- package/dist/schema/hidden/index.d.mts +1 -1
- package/dist/schema/hidden/index.d.ts +1 -1
- package/dist/schema/image/image.d.mts +1 -1
- package/dist/schema/image/image.d.ts +1 -1
- package/dist/schema/image/index.d.mts +1 -1
- package/dist/schema/image/index.d.ts +1 -1
- package/dist/schema/multifield/index.d.mts +1 -1
- package/dist/schema/multifield/index.d.ts +1 -1
- package/dist/schema/multifield/multifield.d.mts +1 -1
- package/dist/schema/multifield/multifield.d.ts +1 -1
- package/dist/schema/object/index.d.mts +1 -1
- package/dist/schema/object/index.d.ts +1 -1
- package/dist/schema/object/object.d.mts +1 -1
- package/dist/schema/object/object.d.ts +1 -1
- package/dist/schema/optional/index.d.mts +1 -1
- package/dist/schema/optional/index.d.ts +1 -1
- package/dist/schema/optional/optional.d.mts +1 -1
- package/dist/schema/optional/optional.d.ts +1 -1
- package/dist/schema/pathbrowser/index.d.mts +1 -1
- package/dist/schema/pathbrowser/index.d.ts +1 -1
- package/dist/schema/pathbrowser/pathbrowser.d.mts +1 -1
- package/dist/schema/pathbrowser/pathbrowser.d.ts +1 -1
- package/dist/schema/rte/index.d.mts +1 -1
- package/dist/schema/rte/index.d.ts +1 -1
- package/dist/schema/rte/rte.d.mts +1 -1
- package/dist/schema/rte/rte.d.ts +1 -1
- package/dist/schema/select/index.d.mts +1 -1
- package/dist/schema/select/index.d.ts +1 -1
- package/dist/schema/select/select.d.mts +1 -1
- package/dist/schema/select/select.d.ts +1 -1
- package/dist/schema/text/index.d.mts +1 -1
- package/dist/schema/text/index.d.ts +1 -1
- package/dist/schema/text/text.d.mts +1 -1
- package/dist/schema/text/text.d.ts +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/infer.d.mts +1 -1
- package/dist/types/infer.d.ts +1 -1
- package/dist/types/object.d.mts +1 -1
- package/dist/types/object.d.ts +1 -1
- package/dist/types/schema.d.mts +1 -1
- package/dist/types/schema.d.ts +1 -1
- package/dist/{types-rfg_xywc.d.ts → types-Cvbi87LT.d.ts} +4 -1
- package/dist/{types-B8taWezd.d.mts → types-DUGwdG43.d.mts} +4 -1
- package/package.json +7 -7
package/LICENSE.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DialogSchema } from '../../schema/dialog/dialog.mjs';
|
|
3
|
-
import { f as ObjectEntries } from '../../types-
|
|
3
|
+
import { f as ObjectEntries } from '../../types-DUGwdG43.mjs';
|
|
4
4
|
import '../../types/utils.mjs';
|
|
5
5
|
import '../../types/webcomponent.mjs';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DialogSchema } from '../../schema/dialog/dialog.js';
|
|
3
|
-
import { f as ObjectEntries } from '../../types-
|
|
3
|
+
import { f as ObjectEntries } from '../../types-Cvbi87LT.js';
|
|
4
4
|
import '../../types/utils.js';
|
|
5
5
|
import '../../types/webcomponent.js';
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as ObjectEntries, S as SlotEntries, B as BaseSchema, g as ObjectOutput } from '../../types-
|
|
1
|
+
import { f as ObjectEntries, S as SlotEntries, B as BaseSchema, g as ObjectOutput } from '../../types-DUGwdG43.mjs';
|
|
2
2
|
import { ComponentModel } from '../../types/component.mjs';
|
|
3
3
|
import { DialogSchema } from '../../schema/dialog/dialog.mjs';
|
|
4
4
|
import '../../types/webcomponent.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as ObjectEntries, S as SlotEntries, B as BaseSchema, g as ObjectOutput } from '../../types-
|
|
1
|
+
import { f as ObjectEntries, S as SlotEntries, B as BaseSchema, g as ObjectOutput } from '../../types-Cvbi87LT.js';
|
|
2
2
|
import { ComponentModel } from '../../types/component.js';
|
|
3
3
|
import { DialogSchema } from '../../schema/dialog/dialog.js';
|
|
4
4
|
import '../../types/webcomponent.js';
|
|
@@ -2,7 +2,7 @@ export { parse } from './parse/parse.mjs';
|
|
|
2
2
|
export { parsePrimitives } from './parse/parsePrimitives.mjs';
|
|
3
3
|
export { ComponentSchema, component } from './component/component.mjs';
|
|
4
4
|
import '../schema/dialog/dialog.mjs';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-DUGwdG43.mjs';
|
|
6
6
|
import '../types/webcomponent.mjs';
|
|
7
7
|
import '../types/utils.mjs';
|
|
8
8
|
import '../types/component.mjs';
|
|
@@ -2,7 +2,7 @@ export { parse } from './parse/parse.js';
|
|
|
2
2
|
export { parsePrimitives } from './parse/parsePrimitives.js';
|
|
3
3
|
export { ComponentSchema, component } from './component/component.js';
|
|
4
4
|
import '../schema/dialog/dialog.js';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-Cvbi87LT.js';
|
|
6
6
|
import '../types/webcomponent.js';
|
|
7
7
|
import '../types/utils.js';
|
|
8
8
|
import '../types/component.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { parse } from './parse.mjs';
|
|
2
2
|
export { parsePrimitives } from './parsePrimitives.mjs';
|
|
3
3
|
import '../../schema/dialog/dialog.mjs';
|
|
4
|
-
import '../../types-
|
|
4
|
+
import '../../types-DUGwdG43.mjs';
|
|
5
5
|
import '../../types/webcomponent.mjs';
|
|
6
6
|
import '../../types/utils.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { parse } from './parse.js';
|
|
2
2
|
export { parsePrimitives } from './parsePrimitives.js';
|
|
3
3
|
import '../../schema/dialog/dialog.js';
|
|
4
|
-
import '../../types-
|
|
4
|
+
import '../../types-Cvbi87LT.js';
|
|
5
5
|
import '../../types/webcomponent.js';
|
|
6
6
|
import '../../types/utils.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DialogSchema } from '../../schema/dialog/dialog.mjs';
|
|
2
2
|
import { WebcomponentPropTypes } from '../../types/webcomponent.mjs';
|
|
3
|
-
import { f as ObjectEntries } from '../../types-
|
|
3
|
+
import { f as ObjectEntries } from '../../types-DUGwdG43.mjs';
|
|
4
4
|
import '../../types/utils.mjs';
|
|
5
5
|
|
|
6
6
|
declare function parsePrimitives<T extends ObjectEntries>(schema: DialogSchema<T>): Record<string, WebcomponentPropTypes>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DialogSchema } from '../../schema/dialog/dialog.js';
|
|
2
2
|
import { WebcomponentPropTypes } from '../../types/webcomponent.js';
|
|
3
|
-
import { f as ObjectEntries } from '../../types-
|
|
3
|
+
import { f as ObjectEntries } from '../../types-Cvbi87LT.js';
|
|
4
4
|
import '../../types/utils.js';
|
|
5
5
|
|
|
6
6
|
declare function parsePrimitives<T extends ObjectEntries>(schema: DialogSchema<T>): Record<string, WebcomponentPropTypes>;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { DialogSchema, dialog } from './schema/dialog/dialog.mjs';
|
|
2
2
|
export { Condition } from './schema/dialog/condition.mjs';
|
|
3
|
-
export { d as BaseFieldInput, B as BaseSchema, b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field, O as OptionalSchema, e as Output, o as optional } from './types-
|
|
3
|
+
export { d as BaseFieldInput, B as BaseSchema, b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field, O as OptionalSchema, e as Output, o as optional } from './types-DUGwdG43.mjs';
|
|
4
4
|
export { Tabs } from './schema/dialog/tabs.mjs';
|
|
5
5
|
export { MultifieldSchema, multifield } from './schema/multifield/multifield.mjs';
|
|
6
6
|
export { TextSchema, text } from './schema/text/text.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { DialogSchema, dialog } from './schema/dialog/dialog.js';
|
|
2
2
|
export { Condition } from './schema/dialog/condition.js';
|
|
3
|
-
export { d as BaseFieldInput, B as BaseSchema, b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field, O as OptionalSchema, e as Output, o as optional } from './types-
|
|
3
|
+
export { d as BaseFieldInput, B as BaseSchema, b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field, O as OptionalSchema, e as Output, o as optional } from './types-Cvbi87LT.js';
|
|
4
4
|
export { Tabs } from './schema/dialog/tabs.js';
|
|
5
5
|
export { MultifieldSchema, multifield } from './schema/multifield/multifield.js';
|
|
6
6
|
export { TextSchema, text } from './schema/text/text.js';
|
package/dist/index.js
CHANGED
|
@@ -117,6 +117,11 @@ function addConditionToField(fields, path, condition) {
|
|
|
117
117
|
if (!field.children) {
|
|
118
118
|
throw new Error(`Field with id "${key}" has no children`);
|
|
119
119
|
}
|
|
120
|
+
const nextKey = keys[i + 1];
|
|
121
|
+
if (nextKey === "$this") {
|
|
122
|
+
field.condition = condition;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
120
125
|
currentFields = field.children;
|
|
121
126
|
}
|
|
122
127
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/schema/dialog/tabs.ts","../src/schema/dialog/condition.ts","../src/utils/pathToArray.ts","../src/schema/dialog/dialog.ts","../src/schema/multifield/multifield.ts","../src/schema/text/text.ts","../src/schema/checkbox/checkbox.ts","../src/schema/pathbrowser/pathbrowser.ts","../src/schema/image/image.ts","../src/schema/select/select.ts","../src/schema/rte/rte.ts","../src/schema/dynamic/dynamic.ts","../src/schema/calendar/calendar.ts","../src/schema/datasource/datasource.ts","../src/schema/group/group.ts","../src/schema/datamodel/datamodel.ts","../src/schema/hidden/hidden.ts","../src/schema/optional/optional.ts","../src/schema/object/object.ts","../src/decorators/webcomponent/webcomponent.ts","../src/utils/pascalToKebab.ts","../src/functions/parse/parse.ts","../src/functions/parse/parsePrimitives.ts","../src/functions/component/component.ts"],"sourcesContent":["export * from \"./schema/dialog\";\n\nexport * from \"./schema/multifield\";\nexport * from \"./schema/text\";\nexport * from \"./schema/checkbox\";\nexport * from \"./schema/pathbrowser\";\nexport * from \"./schema/image\";\nexport * from \"./schema/select\";\nexport * from \"./schema/rte\";\nexport * from \"./schema/dynamic\";\nexport * from \"./schema/calendar\";\nexport * from \"./schema/datasource\";\nexport * from \"./schema/group\";\nexport * from \"./schema/datamodel\";\n\nexport * from \"./schema/hidden\";\nexport * from \"./schema/optional\";\nexport * from \"./schema/object\";\n\nexport * from \"./types\";\n\nexport * from \"./decorators\"\nexport * from \"./functions\"","import { EntryMask } from '../../types';\nimport { Field } from './types';\n\nexport class Tabs<TEntries> {\n private tabs = new Map<string, EntryMask<TEntries>>();\n\n addTab(name: string, entries: EntryMask<TEntries>) {\n this.tabs.set(name, entries);\n }\n\n parse(entries: Field[]) {\n const result = []\n const usedEntries = new Set();\n\n if(this.tabs.size === 0) {\n return entries\n }\n\n for(const [name, mask] of this.tabs) {\n const children = []\n\n if(!mask) {\n throw new Error(`Entry \"${String(name)}\" does not have an appropriate tab configuration.`);\n }\n\n for(const [key,] of Object.entries(mask)) {\n const field = entries.find(f => f.id === key)\n\n if (usedEntries.has(key)) {\n throw new Error(`Entry \"${String(name)}.${String(key)}\" is already used in another tab.`);\n }\n\n if(!field) {\n throw new Error(`Field with id \"${key}\" not found`);\n }\n\n children.push(entries.find(f => f.id === key))\n }\n\n result.push({\n type: 'tab',\n label: name,\n id: `tab_${name.toLowerCase().replaceAll(' ', '')}`,\n children\n })\n }\n\n return [{\n type: 'tabs',\n id: 'tabs',\n children: result\n }]\n }\n}","import { NestedPaths } from '../../types';\nimport { ConditionFn, ConditionOperators, Conditions, Field } from './types';\nimport { ObjectEntries } from '../../types/object';\n\nfunction addConditionToField(fields: Field[], path: string, condition: Conditions): void {\n const keys = path.split('.');\n let currentFields = fields;\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const field = currentFields.find(f => f.id === key);\n\n if (!field) {\n throw new Error(`Field with id \"${key}\" not found`);\n }\n\n if (i === keys.length - 1) {\n field.condition = condition;\n } else {\n if (!field.children) {\n throw new Error(`Field with id \"${key}\" has no children`);\n }\n currentFields = field.children;\n }\n }\n}\n\nexport class Condition<TEntries extends ObjectEntries> {\n private conditions = new Map<string, Conditions>();\n\n addCondition(field: NestedPaths<TEntries>, condition: ConditionFn<TEntries>) {\n const operators: ConditionOperators<TEntries> = {\n eq: (field, value) => ({ operator: 'eq', field, value }),\n neq: (field, value) => ({ operator: 'neq', field, value }),\n exists: (field) => ({ operator: 'exists', field }),\n and: (...operations) => ({ operator: 'and', value: operations }),\n or: (...operations) => ({ operator: 'or', value: operations })\n };\n\n this.conditions.set(field, condition(operators));\n }\n\n parse(entries: Field[]) {\n for (let [key, value] of this.conditions) {\n addConditionToField(entries, key, value)\n }\n\n return entries;\n }\n}\n","interface PathValue {\n path: string[];\n value: any;\n}\n\nexport function pathToArray(obj: Record<string, any>, parentPath: string[] = []): PathValue[] {\n const result: PathValue[] = [];\n\n for (const [key, value] of Object.entries(obj)) {\n const currentPath = [...parentPath, key];\n\n if (typeof value === 'object' && !value.hasOwnProperty('operator') && !Array.isArray(value)) {\n // If the value is an object, recurse into it\n result.push(...pathToArray(value, currentPath));\n } else {\n // If the value is not an object, store the path and value\n result.push({ path: currentPath, value });\n }\n }\n\n return result;\n}","import { BaseSchema, EntryMask, NestedPaths } from '../../types';\nimport { ObjectEntries, ObjectOutput } from '../../types/object';\nimport { Tabs } from './tabs';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { Condition } from './condition';\nimport { pathToArray } from '../../utils/pathToArray';\nimport { ConditionsArgument } from './types';\n\nexport interface DialogSchema<TEntries extends ObjectEntries> extends BaseSchema<ObjectOutput<TEntries>> {\n type: 'dialog';\n tabs: (tabs: Record<string, EntryMask<TEntries>>) => DialogSchema<TEntries>;\n conditions: (conditions: ConditionsArgument<TEntries>) => DialogSchema<TEntries>;\n}\n\nclass DialogBuilder<TEntries extends ObjectEntries> implements DialogSchema<TEntries> {\n private conditionsModule: Condition<TEntries>;\n private tabsModule: Tabs<TEntries>;\n private readonly entries: TEntries;\n readonly type = 'dialog';\n\n constructor(entries: TEntries) {\n this.entries = entries;\n this.conditionsModule = new Condition<TEntries>();\n this.tabsModule = new Tabs<TEntries>();\n }\n\n conditions(conditions: ConditionsArgument<TEntries>) {\n const conditionsArray = pathToArray(conditions)\n for (const condition of conditionsArray) {\n this.conditionsModule.addCondition(condition.path.join('.') as NestedPaths<TEntries>, condition.value);\n }\n return this;\n }\n\n tabs(tabs: Record<string, EntryMask<TEntries>>) {\n for (const [key, tab] of Object.entries(tabs)) {\n this.tabsModule.addTab(key as any, tab!);\n }\n return this;\n }\n\n _parse() {\n const dialog = Object.entries(this.entries)\n .map(([key, entry]) => ({\n id: key,\n name: key,\n ...entry._parse(),\n }))\n .filter((entry: object) => {\n if ('type' in entry) {\n return entry.type !== 'hidden';\n }\n });\n\n const dialogWithConditions = this.conditionsModule.parse(dialog);\n const dialogWithTabs = this.tabsModule.parse(dialogWithConditions);\n return {\n dialog: dialogWithTabs\n };\n }\n\n _primitive() {\n const result: Record<string, WebcomponentPropTypes> = {};\n\n for (const [key, entry] of Object.entries(this.entries)) {\n const type = entry._primitive();\n if (typeof type === 'string') {\n result[key] = type;\n }\n }\n\n return result;\n }\n}\n\nexport function dialog<TEntries extends ObjectEntries>(entries: TEntries) {\n return new DialogBuilder(entries)\n}","import {\n BaseFieldInput,\n BaseSchema,\n InferOutput\n} from '../../types';\n\nexport interface MultifieldSchema<\n TChildren extends BaseSchema<unknown>,\n> extends BaseSchema<InferOutput<TChildren>[]> {\n readonly type: 'multifield';\n /**\n * The children item schema.\n */\n readonly children: TChildren;\n}\n\ninterface MultifieldInput<TChildren extends BaseSchema<unknown>> extends BaseFieldInput {\n children: TChildren\n}\n\nexport function multifield<const TChildren extends BaseSchema<unknown>>(input: MultifieldInput<TChildren>): MultifieldSchema<TChildren> {\n const {label, children, required} = input;\n const childrenParse = children._parse();\n\n return {\n type: 'multifield',\n _parse() {\n return {\n type: 'multifield',\n label,\n required,\n children: Array.isArray(childrenParse) ? childrenParse : [childrenParse]\n }\n },\n _primitive() {\n return 'json'\n },\n ...input\n };\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface TextSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'textfield';\n}\n\ninterface TextInput extends BaseFieldInput {\n placeholder?: string;\n}\n\nexport function text(input: TextInput): TextSchema {\n const {placeholder, label,tooltip, required} = input;\n\n return {\n type: 'textfield',\n _parse() {\n return {\n type: 'textfield',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface CheckBoxSchema<TOutput extends boolean = boolean> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'checkbox';\n}\n\ninterface CheckBoxInput extends BaseFieldInput {\n showastoggle?: boolean\n}\n\nexport function checkbox(input: CheckBoxInput): CheckBoxSchema {\n const {label, tooltip, showastoggle = false} = input;\n\n return {\n type: 'checkbox',\n _parse() {\n return {\n type: 'checkbox',\n label,\n tooltip,\n showastoggle\n }\n },\n _primitive() {\n return 'boolean'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface PathBrowserSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'pathbrowser';\n}\n\ninterface PathBrowserInput extends BaseFieldInput {\n placeholder: string;\n}\n\nexport function pathbrowser(input: PathBrowserInput): PathBrowserSchema {\n const {placeholder, label, tooltip, required} = input;\n\n return {\n type: 'pathbrowser',\n _parse() {\n return {\n type: 'pathbrowser',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface ImageSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'image';\n}\n\ninterface ImageInput extends BaseFieldInput {\n}\n\nexport function image(input: ImageInput): ImageSchema {\n const {label, tooltip, required} = input;\n\n return {\n type: 'image',\n _parse() {\n return {\n type: 'image',\n label,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, BaseSchema } from '../../types';\n\ntype ReadonlyObject<T> = {\n readonly [K in keyof T]: T[K];\n};\n\nexport interface SelectSchema<T, TMultiple extends boolean = false> extends BaseSchema<TMultiple extends true ? T[] : T> {\n /**\n * The schema type.\n */\n type: 'select';\n multiple: TMultiple\n}\n\ninterface SelectInput extends BaseFieldInput {\n placeholder?: string;\n multiple?: boolean;\n values: {\n value: string;\n label: string;\n }[];\n}\n\n\ntype ValuesType<T extends { values: readonly { value: string }[] }> = T['values'][number]['value'];\n\nexport function select<const T extends SelectInput, TMultiple extends boolean= T['multiple'] extends true ? true : false>(input: T): SelectSchema<ValuesType<ReadonlyObject<T>>, TMultiple>{\n const { label, values, tooltip, placeholder, multiple = false, required } = input;\n\n return {\n type: 'select',\n _parse() {\n return {\n type: 'select',\n label,\n multiple,\n values,\n tooltip,\n placeholder,\n required\n };\n },\n _primitive() {\n return multiple ? 'json' : 'string';\n },\n ...input,\n multiple: multiple as TMultiple,\n };\n}\n","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface RichTextEditorSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'richtexteditor';\n}\n\ninterface RichTextEditorInput extends BaseFieldInput {\n placeholder?: string;\n}\n\nexport function rte(input: RichTextEditorInput): RichTextEditorSchema {\n const {placeholder, label, tooltip, required} = input;\n\n return {\n type: 'richtexteditor',\n _parse() {\n return {\n type: 'richtexteditor',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import {\n BaseSchema,\n} from '../../types';\n\nexport interface DynamicZoneSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'dynamic';\n}\n\ninterface DynamicInput {\n}\n\nexport function dynamic(input: DynamicInput): DynamicZoneSchema {\n return {\n type: 'dynamic',\n _parse() {\n return {\n type: 'dynamic',\n };\n },\n _primitive() {\n return 'string';\n },\n ...input,\n };\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface CalendarSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'calendar';\n}\n\ninterface CalendarInput extends BaseFieldInput {\n placeholder?: string;\n valueformat: string;\n displayformat: string;\n headerformat: string;\n startday?: string;\n min?: string;\n max?: string;\n}\n\nexport function calendar(input: CalendarInput): CalendarSchema {\n const {valueformat,startday=0,min,max, placeholder, label,tooltip,required} = input;\n\n return {\n type: 'calendar',\n _parse() {\n return {\n type: 'calendar',\n label,\n valueformat,\n placeholder,\n startday,\n tooltip,\n min,\n max,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\nimport { SelectSchema } from '../select';\ntype DataSourceOutputType<Multiple extends boolean> = Multiple extends true ? string[] : string;\n\nexport interface DataSourceSchema<Multiple extends boolean = false> extends BaseSchema<DataSourceOutputType<Multiple>> {\n /**\n * The schema type.\n */\n type: 'datasource';\n}\n\ninterface DataSourceBody {\n [key: string]: any;\n}\ninterface DataSourceInput extends BaseFieldInput {\n placeholder?: string;\n url: string;\n multiple?: boolean;\n body: DataSourceBody;\n}\n\nexport function datasource<Multiple extends boolean = false>(input: DataSourceInput & { multiple?: Multiple }): DataSourceSchema<Multiple> {\n const {label, body, url, tooltip,placeholder, multiple = false as Multiple, required } = input;\n\n return {\n type: 'datasource',\n _parse() {\n return {\n type: 'datasource',\n label,\n url,\n multiple,\n body,\n tooltip,\n placeholder,\n required,\n }\n },\n _primitive() {\n return multiple ? 'json' : 'string';\n },\n ...input,\n }\n}\n","import {\n BaseFieldInput,\n BaseSchema,\n InferOutput,\n} from '../../types';\n\nexport interface GroupSchema<\n TChildren extends BaseSchema<unknown>,\n> extends BaseSchema<{\n active: boolean;\n} & InferOutput<TChildren>> {\n readonly type: 'group';\n /**\n * The children item schema.\n */\n readonly children: TChildren;\n}\n\ninterface MultifieldInput<TChildren extends BaseSchema<unknown>> extends BaseFieldInput {\n children: TChildren;\n toggle?: boolean;\n}\n\nexport function group<const TChildren extends BaseSchema<unknown>>(input: MultifieldInput<TChildren>): GroupSchema<TChildren> {\n const { label, children, tooltip, toggle } = input;\n const childrenParse = children._parse();\n\n return {\n type: 'group',\n _parse() {\n return {\n type: 'group',\n label,\n tooltip,\n toggle,\n children: Array.isArray(childrenParse) ? childrenParse : [childrenParse],\n };\n },\n _primitive() {\n return 'json';\n },\n ...input,\n };\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface DataModelSchema<TOutput extends Record<string, any> = Record<string, any>> extends BaseSchema<TOutput> { /**\n * The schema type.\n */\n type: 'datamodel';\n}\n\ninterface DataModelInput extends BaseFieldInput {\n placeholder?: string;\n}\n\nexport function datamodel(input: DataModelInput): DataModelSchema {\n const {placeholder, label,tooltip, required} = input;\n\n return {\n type: 'datamodel',\n _parse() {\n return {\n type: 'datamodel',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'json'\n },\n ...input,\n }\n}","import { type BaseSchema } from '../../types';\nimport { type WebcomponentPropTypes } from '../../types/webcomponent';\n\nexport interface HiddenSchema extends BaseSchema<string> {\n /**\n * The schema type.\n */\n type: 'hidden';\n}\n\ninterface HiddenInput {\n type: WebcomponentPropTypes\n}\n\n/**\n * Creates a hidden schema.\n *\n * @param input The type of input for the webcomponent binding.\n *\n * @returns A hidden schema.\n */\nexport function hidden(input: HiddenInput): HiddenSchema {\n const {type} = input;\n\n return {\n type: 'hidden',\n _parse() {\n //Explicitly hidding this input from the parse final result.\n return this;\n },\n _primitive() {\n return type\n },\n }\n}","import { BaseSchema, Output } from '../../types';\n\n/**\n * Optional schema type.\n */\nexport interface OptionalSchema<\n TWrapped extends BaseSchema,\n TOutput = Output<TWrapped> | undefined\n> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'optional';\n /**\n * The wrapped schema.\n */\n wrapped: TWrapped;\n}\n\n\n/**\n * Creates an optional schema.\n *\n * @param wrapped The wrapped schema.\n *\n * @returns A optional schema.\n */\nexport function optional<TWrapped extends BaseSchema>(\n wrapped: TWrapped\n): OptionalSchema<TWrapped> {\n return {\n type: 'optional',\n wrapped,\n _primitive() {\n return this.wrapped._primitive();\n },\n _parse() {\n return this.wrapped._parse();\n },\n };\n}","import type { BaseSchema } from '../../types';\nimport { ObjectEntries, ObjectOutput } from '../../types/object';\n\nexport interface ObjectSchema<TEntries extends ObjectEntries, TOutput = ObjectOutput<TEntries>> extends BaseSchema<TOutput> {\n type: 'object';\n}\n\nexport function object<TEntries extends ObjectEntries>(entries: TEntries): ObjectSchema<TEntries> {\n return {\n type: 'object',\n _parse() {\n return Object.entries(entries)\n .map(([key, entry]) => ({\n id: key,\n name: key,\n ...entry._parse()\n }))\n .filter((entry: object) => {\n if('type' in entry){\n return entry.type !== 'hidden'\n }\n })\n },\n _primitive() {\n return 'json'\n }\n };\n}","import type React from 'react';\nimport r2wc from '@r2wc/react-to-web-component';\nimport { DialogSchema } from '../../schema/dialog';\nimport { pascalToKebab } from '../../utils/pascalToKebab';\nimport { parsePrimitives } from '../../functions';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { ObjectEntries } from '../../types/object';\n\ntype BaseOptions = {}\n\nexport function webcomponent<T extends ObjectEntries>(schema?: DialogSchema<T>, options?: BaseOptions) {\n const props: Record<string, WebcomponentPropTypes> | undefined = schema ? {\n ...parsePrimitives(schema),\n } : undefined;\n\n return <P extends {} = {}>(component: React.ComponentType<P>) => {\n const name = pascalToKebab(component.displayName!)\n\n if (!window.customElements.get(name)) {\n customElements.define(\n name,\n r2wc(component, {\n props,\n }),\n );\n }\n }\n}","export function pascalToKebab(pascalCaseString: string) {\n return pascalCaseString\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .toLowerCase();\n}","import { DialogSchema } from '../../schema/dialog';\nimport { ObjectEntries } from '../../types/object';\n\nexport function parse<T extends ObjectEntries>(schema: DialogSchema<T>) {\n return schema._parse()\n}","import { DialogSchema } from '../../schema/dialog';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { ObjectEntries } from '../../types/object';\n\nexport function parsePrimitives<T extends ObjectEntries>(schema: DialogSchema<T>) {\n return schema._primitive() as Record<string, WebcomponentPropTypes>\n}","import { BaseSchema, ComponentModel } from '../../types';\nimport { ObjectEntries, ObjectOutput, SlotEntries } from '../../types/object';\nimport { DialogSchema } from '../../schema/dialog';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\n\nexport interface ComponentSchema<TEntries extends ObjectEntries, TSlots extends SlotEntries | undefined> extends BaseSchema<ObjectOutput<TEntries & TSlots>>, Partial<ComponentModel> {\n type: 'component';\n dialog: DialogSchema<TEntries>;\n slots?: TSlots,\n}\n\nexport function component<TEntries extends ObjectEntries, TSlots extends SlotEntries | undefined>(\n config: Partial<ComponentModel>,\n dialog: DialogSchema<TEntries>,\n slots?: TSlots,\n): ComponentSchema<TEntries, TSlots> {\n\n const slotsParse = slots ? Object.entries(slots).map(([key, slot]) => (\n {\n id: key,\n name: key,\n ...slot._parse(),\n }),\n ) : [];\n const slotsPrimitives = slots ? Object.entries(slots).reduce((acc, [key, slot]) => {\n acc[key] = slot._primitive();\n return acc\n }, {} as Record<string, WebcomponentPropTypes | Record<string, WebcomponentPropTypes>>) : [];\n\n return {\n type: 'component',\n dialog,\n _parse() {\n return {\n ...config,\n ...dialog._parse(),\n dynamiczones: slotsParse,\n };\n },\n _primitive() {\n return {\n ...dialog._primitive() as object,\n ...slotsPrimitives as object,\n };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CAAoBC,eAAsC;AAC/D,UAAM,OAAO,cAAcA,WAAU,WAAY;AAEjD,QAAI,CAAC,OAAO,eAAe,IAAI,IAAI,GAAG;AACpC,qBAAe;AAAA,QACb;AAAA,YACA,8BAAAC,SAAKD,YAAW;AAAA,UACd;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;","names":["field","dialog","dialog","component","r2wc"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/schema/dialog/tabs.ts","../src/schema/dialog/condition.ts","../src/utils/pathToArray.ts","../src/schema/dialog/dialog.ts","../src/schema/multifield/multifield.ts","../src/schema/text/text.ts","../src/schema/checkbox/checkbox.ts","../src/schema/pathbrowser/pathbrowser.ts","../src/schema/image/image.ts","../src/schema/select/select.ts","../src/schema/rte/rte.ts","../src/schema/dynamic/dynamic.ts","../src/schema/calendar/calendar.ts","../src/schema/datasource/datasource.ts","../src/schema/group/group.ts","../src/schema/datamodel/datamodel.ts","../src/schema/hidden/hidden.ts","../src/schema/optional/optional.ts","../src/schema/object/object.ts","../src/decorators/webcomponent/webcomponent.ts","../src/utils/pascalToKebab.ts","../src/functions/parse/parse.ts","../src/functions/parse/parsePrimitives.ts","../src/functions/component/component.ts"],"sourcesContent":["export * from \"./schema/dialog\";\n\nexport * from \"./schema/multifield\";\nexport * from \"./schema/text\";\nexport * from \"./schema/checkbox\";\nexport * from \"./schema/pathbrowser\";\nexport * from \"./schema/image\";\nexport * from \"./schema/select\";\nexport * from \"./schema/rte\";\nexport * from \"./schema/dynamic\";\nexport * from \"./schema/calendar\";\nexport * from \"./schema/datasource\";\nexport * from \"./schema/group\";\nexport * from \"./schema/datamodel\";\n\nexport * from \"./schema/hidden\";\nexport * from \"./schema/optional\";\nexport * from \"./schema/object\";\n\nexport * from \"./types\";\n\nexport * from \"./decorators\"\nexport * from \"./functions\"","import { EntryMask } from '../../types';\nimport { Field } from './types';\n\nexport class Tabs<TEntries> {\n private tabs = new Map<string, EntryMask<TEntries>>();\n\n addTab(name: string, entries: EntryMask<TEntries>) {\n this.tabs.set(name, entries);\n }\n\n parse(entries: Field[]) {\n const result = []\n const usedEntries = new Set();\n\n if(this.tabs.size === 0) {\n return entries\n }\n\n for(const [name, mask] of this.tabs) {\n const children = []\n\n if(!mask) {\n throw new Error(`Entry \"${String(name)}\" does not have an appropriate tab configuration.`);\n }\n\n for(const [key,] of Object.entries(mask)) {\n const field = entries.find(f => f.id === key)\n\n if (usedEntries.has(key)) {\n throw new Error(`Entry \"${String(name)}.${String(key)}\" is already used in another tab.`);\n }\n\n if(!field) {\n throw new Error(`Field with id \"${key}\" not found`);\n }\n\n children.push(entries.find(f => f.id === key))\n }\n\n result.push({\n type: 'tab',\n label: name,\n id: `tab_${name.toLowerCase().replaceAll(' ', '')}`,\n children\n })\n }\n\n return [{\n type: 'tabs',\n id: 'tabs',\n children: result\n }]\n }\n}","import { NestedPaths } from '../../types';\nimport { ConditionFn, ConditionOperators, Conditions, Field } from './types';\nimport { ObjectEntries } from '../../types/object';\n\nfunction addConditionToField(fields: Field[], path: string, condition: Conditions): void {\n const keys = path.split('.');\n let currentFields = fields;\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const field = currentFields.find(f => f.id === key);\n\n if (!field) {\n throw new Error(`Field with id \"${key}\" not found`);\n }\n\n if (i === keys.length - 1) {\n field.condition = condition;\n } else {\n if (!field.children) {\n throw new Error(`Field with id \"${key}\" has no children`);\n }\n\n const nextKey = keys[i + 1];\n if(nextKey === '$this') {\n field.condition = condition;\n break;\n }\n currentFields = field.children;\n }\n }\n}\n\nexport class Condition<TEntries extends ObjectEntries> {\n private conditions = new Map<string, Conditions>();\n\n addCondition(field: NestedPaths<TEntries>, condition: ConditionFn<TEntries>) {\n const operators: ConditionOperators<TEntries> = {\n eq: (field, value) => ({ operator: 'eq', field, value }),\n neq: (field, value) => ({ operator: 'neq', field, value }),\n exists: (field) => ({ operator: 'exists', field }),\n and: (...operations) => ({ operator: 'and', value: operations }),\n or: (...operations) => ({ operator: 'or', value: operations })\n };\n\n this.conditions.set(field, condition(operators));\n }\n\n parse(entries: Field[]) {\n for (let [key, value] of this.conditions) {\n addConditionToField(entries, key, value)\n }\n\n return entries;\n }\n}\n","interface PathValue {\n path: string[];\n value: any;\n}\n\nexport function pathToArray(obj: Record<string, any>, parentPath: string[] = []): PathValue[] {\n const result: PathValue[] = [];\n\n for (const [key, value] of Object.entries(obj)) {\n const currentPath = [...parentPath, key];\n\n if (typeof value === 'object' && !value.hasOwnProperty('operator') && !Array.isArray(value)) {\n // If the value is an object, recurse into it\n result.push(...pathToArray(value, currentPath));\n } else {\n // If the value is not an object, store the path and value\n result.push({ path: currentPath, value });\n }\n }\n\n return result;\n}","import { BaseSchema, EntryMask, NestedPaths } from '../../types';\nimport { ObjectEntries, ObjectOutput } from '../../types/object';\nimport { Tabs } from './tabs';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { Condition } from './condition';\nimport { pathToArray } from '../../utils/pathToArray';\nimport { ConditionsArgument } from './types';\n\nexport interface DialogSchema<TEntries extends ObjectEntries> extends BaseSchema<ObjectOutput<TEntries>> {\n type: 'dialog';\n tabs: (tabs: Record<string, EntryMask<TEntries>>) => DialogSchema<TEntries>;\n conditions: (conditions: ConditionsArgument<TEntries>) => DialogSchema<TEntries>;\n}\n\nclass DialogBuilder<TEntries extends ObjectEntries> implements DialogSchema<TEntries> {\n private conditionsModule: Condition<TEntries>;\n private tabsModule: Tabs<TEntries>;\n private readonly entries: TEntries;\n readonly type = 'dialog';\n\n constructor(entries: TEntries) {\n this.entries = entries;\n this.conditionsModule = new Condition<TEntries>();\n this.tabsModule = new Tabs<TEntries>();\n }\n\n conditions(conditions: ConditionsArgument<TEntries>) {\n const conditionsArray = pathToArray(conditions)\n for (const condition of conditionsArray) {\n this.conditionsModule.addCondition(condition.path.join('.') as NestedPaths<TEntries>, condition.value);\n }\n return this;\n }\n\n tabs(tabs: Record<string, EntryMask<TEntries>>) {\n for (const [key, tab] of Object.entries(tabs)) {\n this.tabsModule.addTab(key as any, tab!);\n }\n return this;\n }\n\n _parse() {\n const dialog = Object.entries(this.entries)\n .map(([key, entry]) => ({\n id: key,\n name: key,\n ...entry._parse(),\n }))\n .filter((entry: object) => {\n if ('type' in entry) {\n return entry.type !== 'hidden';\n }\n });\n\n const dialogWithConditions = this.conditionsModule.parse(dialog);\n const dialogWithTabs = this.tabsModule.parse(dialogWithConditions);\n return {\n dialog: dialogWithTabs\n };\n }\n\n _primitive() {\n const result: Record<string, WebcomponentPropTypes> = {};\n\n for (const [key, entry] of Object.entries(this.entries)) {\n const type = entry._primitive();\n if (typeof type === 'string') {\n result[key] = type;\n }\n }\n\n return result;\n }\n}\n\nexport function dialog<TEntries extends ObjectEntries>(entries: TEntries) {\n return new DialogBuilder(entries)\n}","import {\n BaseFieldInput,\n BaseSchema,\n InferOutput\n} from '../../types';\n\nexport interface MultifieldSchema<\n TChildren extends BaseSchema<unknown>,\n> extends BaseSchema<InferOutput<TChildren>[]> {\n readonly type: 'multifield';\n /**\n * The children item schema.\n */\n readonly children: TChildren;\n}\n\ninterface MultifieldInput<TChildren extends BaseSchema<unknown>> extends BaseFieldInput {\n children: TChildren\n}\n\nexport function multifield<const TChildren extends BaseSchema<unknown>>(input: MultifieldInput<TChildren>): MultifieldSchema<TChildren> {\n const {label, children, required} = input;\n const childrenParse = children._parse();\n\n return {\n type: 'multifield',\n _parse() {\n return {\n type: 'multifield',\n label,\n required,\n children: Array.isArray(childrenParse) ? childrenParse : [childrenParse]\n }\n },\n _primitive() {\n return 'json'\n },\n ...input\n };\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface TextSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'textfield';\n}\n\ninterface TextInput extends BaseFieldInput {\n placeholder?: string;\n}\n\nexport function text(input: TextInput): TextSchema {\n const {placeholder, label,tooltip, required} = input;\n\n return {\n type: 'textfield',\n _parse() {\n return {\n type: 'textfield',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface CheckBoxSchema<TOutput extends boolean = boolean> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'checkbox';\n}\n\ninterface CheckBoxInput extends BaseFieldInput {\n showastoggle?: boolean\n}\n\nexport function checkbox(input: CheckBoxInput): CheckBoxSchema {\n const {label, tooltip, showastoggle = false} = input;\n\n return {\n type: 'checkbox',\n _parse() {\n return {\n type: 'checkbox',\n label,\n tooltip,\n showastoggle\n }\n },\n _primitive() {\n return 'boolean'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface PathBrowserSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'pathbrowser';\n}\n\ninterface PathBrowserInput extends BaseFieldInput {\n placeholder: string;\n}\n\nexport function pathbrowser(input: PathBrowserInput): PathBrowserSchema {\n const {placeholder, label, tooltip, required} = input;\n\n return {\n type: 'pathbrowser',\n _parse() {\n return {\n type: 'pathbrowser',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface ImageSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'image';\n}\n\ninterface ImageInput extends BaseFieldInput {\n}\n\nexport function image(input: ImageInput): ImageSchema {\n const {label, tooltip, required} = input;\n\n return {\n type: 'image',\n _parse() {\n return {\n type: 'image',\n label,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, BaseSchema } from '../../types';\n\ntype ReadonlyObject<T> = {\n readonly [K in keyof T]: T[K];\n};\n\nexport interface SelectSchema<T, TMultiple extends boolean = false> extends BaseSchema<TMultiple extends true ? T[] : T> {\n /**\n * The schema type.\n */\n type: 'select';\n multiple: TMultiple\n}\n\ninterface SelectInput extends BaseFieldInput {\n placeholder?: string;\n multiple?: boolean;\n values: {\n value: string;\n label: string;\n }[];\n}\n\n\ntype ValuesType<T extends { values: readonly { value: string }[] }> = T['values'][number]['value'];\n\nexport function select<const T extends SelectInput, TMultiple extends boolean= T['multiple'] extends true ? true : false>(input: T): SelectSchema<ValuesType<ReadonlyObject<T>>, TMultiple>{\n const { label, values, tooltip, placeholder, multiple = false, required } = input;\n\n return {\n type: 'select',\n _parse() {\n return {\n type: 'select',\n label,\n multiple,\n values,\n tooltip,\n placeholder,\n required\n };\n },\n _primitive() {\n return multiple ? 'json' : 'string';\n },\n ...input,\n multiple: multiple as TMultiple,\n };\n}\n","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface RichTextEditorSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'richtexteditor';\n}\n\ninterface RichTextEditorInput extends BaseFieldInput {\n placeholder?: string;\n}\n\nexport function rte(input: RichTextEditorInput): RichTextEditorSchema {\n const {placeholder, label, tooltip, required} = input;\n\n return {\n type: 'richtexteditor',\n _parse() {\n return {\n type: 'richtexteditor',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import {\n BaseSchema,\n} from '../../types';\n\nexport interface DynamicZoneSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'dynamic';\n}\n\ninterface DynamicInput {\n}\n\nexport function dynamic(input: DynamicInput): DynamicZoneSchema {\n return {\n type: 'dynamic',\n _parse() {\n return {\n type: 'dynamic',\n };\n },\n _primitive() {\n return 'string';\n },\n ...input,\n };\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface CalendarSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'calendar';\n}\n\ninterface CalendarInput extends BaseFieldInput {\n placeholder?: string;\n valueformat: string;\n displayformat: string;\n headerformat: string;\n startday?: string;\n min?: string;\n max?: string;\n}\n\nexport function calendar(input: CalendarInput): CalendarSchema {\n const {valueformat,startday=0,min,max, placeholder, label,tooltip,required} = input;\n\n return {\n type: 'calendar',\n _parse() {\n return {\n type: 'calendar',\n label,\n valueformat,\n placeholder,\n startday,\n tooltip,\n min,\n max,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\nimport { SelectSchema } from '../select';\ntype DataSourceOutputType<Multiple extends boolean> = Multiple extends true ? string[] : string;\n\nexport interface DataSourceSchema<Multiple extends boolean = false> extends BaseSchema<DataSourceOutputType<Multiple>> {\n /**\n * The schema type.\n */\n type: 'datasource';\n}\n\ninterface DataSourceBody {\n [key: string]: any;\n}\ninterface DataSourceInput extends BaseFieldInput {\n placeholder?: string;\n url: string;\n multiple?: boolean;\n body: DataSourceBody;\n}\n\nexport function datasource<Multiple extends boolean = false>(input: DataSourceInput & { multiple?: Multiple }): DataSourceSchema<Multiple> {\n const {label, body, url, tooltip,placeholder, multiple = false as Multiple, required } = input;\n\n return {\n type: 'datasource',\n _parse() {\n return {\n type: 'datasource',\n label,\n url,\n multiple,\n body,\n tooltip,\n placeholder,\n required,\n }\n },\n _primitive() {\n return multiple ? 'json' : 'string';\n },\n ...input,\n }\n}\n","import {\n BaseFieldInput,\n BaseSchema,\n InferOutput,\n} from '../../types';\n\nexport interface GroupSchema<\n TChildren extends BaseSchema<unknown>,\n> extends BaseSchema<{\n active: boolean;\n} & InferOutput<TChildren>> {\n readonly type: 'group';\n /**\n * The children item schema.\n */\n readonly children: TChildren;\n}\n\ninterface MultifieldInput<TChildren extends BaseSchema<unknown>> extends BaseFieldInput {\n children: TChildren;\n toggle?: boolean;\n}\n\nexport function group<const TChildren extends BaseSchema<unknown>>(input: MultifieldInput<TChildren>): GroupSchema<TChildren> {\n const { label, children, tooltip, toggle } = input;\n const childrenParse = children._parse();\n\n return {\n type: 'group',\n _parse() {\n return {\n type: 'group',\n label,\n tooltip,\n toggle,\n children: Array.isArray(childrenParse) ? childrenParse : [childrenParse],\n };\n },\n _primitive() {\n return 'json';\n },\n ...input,\n };\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface DataModelSchema<TOutput extends Record<string, any> = Record<string, any>> extends BaseSchema<TOutput> { /**\n * The schema type.\n */\n type: 'datamodel';\n}\n\ninterface DataModelInput extends BaseFieldInput {\n placeholder?: string;\n}\n\nexport function datamodel(input: DataModelInput): DataModelSchema {\n const {placeholder, label,tooltip, required} = input;\n\n return {\n type: 'datamodel',\n _parse() {\n return {\n type: 'datamodel',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'json'\n },\n ...input,\n }\n}","import { type BaseSchema } from '../../types';\nimport { type WebcomponentPropTypes } from '../../types/webcomponent';\n\nexport interface HiddenSchema extends BaseSchema<string> {\n /**\n * The schema type.\n */\n type: 'hidden';\n}\n\ninterface HiddenInput {\n type: WebcomponentPropTypes\n}\n\n/**\n * Creates a hidden schema.\n *\n * @param input The type of input for the webcomponent binding.\n *\n * @returns A hidden schema.\n */\nexport function hidden(input: HiddenInput): HiddenSchema {\n const {type} = input;\n\n return {\n type: 'hidden',\n _parse() {\n //Explicitly hidding this input from the parse final result.\n return this;\n },\n _primitive() {\n return type\n },\n }\n}","import { BaseSchema, Output } from '../../types';\n\n/**\n * Optional schema type.\n */\nexport interface OptionalSchema<\n TWrapped extends BaseSchema,\n TOutput = Output<TWrapped> | undefined\n> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'optional';\n /**\n * The wrapped schema.\n */\n wrapped: TWrapped;\n}\n\n\n/**\n * Creates an optional schema.\n *\n * @param wrapped The wrapped schema.\n *\n * @returns A optional schema.\n */\nexport function optional<TWrapped extends BaseSchema>(\n wrapped: TWrapped\n): OptionalSchema<TWrapped> {\n return {\n type: 'optional',\n wrapped,\n _primitive() {\n return this.wrapped._primitive();\n },\n _parse() {\n return this.wrapped._parse();\n },\n };\n}","import type { BaseSchema } from '../../types';\nimport { ObjectEntries, ObjectOutput } from '../../types/object';\n\nexport interface ObjectSchema<TEntries extends ObjectEntries, TOutput = ObjectOutput<TEntries>> extends BaseSchema<TOutput> {\n type: 'object';\n}\n\nexport function object<TEntries extends ObjectEntries>(entries: TEntries): ObjectSchema<TEntries> {\n return {\n type: 'object',\n _parse() {\n return Object.entries(entries)\n .map(([key, entry]) => ({\n id: key,\n name: key,\n ...entry._parse()\n }))\n .filter((entry: object) => {\n if('type' in entry){\n return entry.type !== 'hidden'\n }\n })\n },\n _primitive() {\n return 'json'\n }\n };\n}","import type React from 'react';\nimport r2wc from '@r2wc/react-to-web-component';\nimport { DialogSchema } from '../../schema/dialog';\nimport { pascalToKebab } from '../../utils/pascalToKebab';\nimport { parsePrimitives } from '../../functions';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { ObjectEntries } from '../../types/object';\n\ntype BaseOptions = {}\n\nexport function webcomponent<T extends ObjectEntries>(schema?: DialogSchema<T>, options?: BaseOptions) {\n const props: Record<string, WebcomponentPropTypes> | undefined = schema ? {\n ...parsePrimitives(schema),\n } : undefined;\n\n return <P extends {} = {}>(component: React.ComponentType<P>) => {\n const name = pascalToKebab(component.displayName!)\n\n if (!window.customElements.get(name)) {\n customElements.define(\n name,\n r2wc(component, {\n props,\n }),\n );\n }\n }\n}","export function pascalToKebab(pascalCaseString: string) {\n return pascalCaseString\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .toLowerCase();\n}","import { DialogSchema } from '../../schema/dialog';\nimport { ObjectEntries } from '../../types/object';\n\nexport function parse<T extends ObjectEntries>(schema: DialogSchema<T>) {\n return schema._parse()\n}","import { DialogSchema } from '../../schema/dialog';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { ObjectEntries } from '../../types/object';\n\nexport function parsePrimitives<T extends ObjectEntries>(schema: DialogSchema<T>) {\n return schema._primitive() as Record<string, WebcomponentPropTypes>\n}","import { BaseSchema, ComponentModel } from '../../types';\nimport { ObjectEntries, ObjectOutput, SlotEntries } from '../../types/object';\nimport { DialogSchema } from '../../schema/dialog';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\n\nexport interface ComponentSchema<TEntries extends ObjectEntries, TSlots extends SlotEntries | undefined> extends BaseSchema<ObjectOutput<TEntries & TSlots>>, Partial<ComponentModel> {\n type: 'component';\n dialog: DialogSchema<TEntries>;\n slots?: TSlots,\n}\n\nexport function component<TEntries extends ObjectEntries, TSlots extends SlotEntries | undefined>(\n config: Partial<ComponentModel>,\n dialog: DialogSchema<TEntries>,\n slots?: TSlots,\n): ComponentSchema<TEntries, TSlots> {\n\n const slotsParse = slots ? Object.entries(slots).map(([key, slot]) => (\n {\n id: key,\n name: key,\n ...slot._parse(),\n }),\n ) : [];\n const slotsPrimitives = slots ? Object.entries(slots).reduce((acc, [key, slot]) => {\n acc[key] = slot._primitive();\n return acc\n }, {} as Record<string, WebcomponentPropTypes | Record<string, WebcomponentPropTypes>>) : [];\n\n return {\n type: 'component',\n dialog,\n _parse() {\n return {\n ...config,\n ...dialog._parse(),\n dynamiczones: slotsParse,\n };\n },\n _primitive() {\n return {\n ...dialog._primitive() as object,\n ...slotsPrimitives as object,\n };\n },\n ...config,\n };\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,OAAN,MAAqB;AAAA,EAArB;AACL,wBAAQ,QAAO,oBAAI,IAAiC;AAAA;AAAA,EAEpD,OAAO,MAAc,SAA8B;AACjD,SAAK,KAAK,IAAI,MAAM,OAAO;AAAA,EAC7B;AAAA,EAEA,MAAM,SAAkB;AACtB,UAAM,SAAS,CAAC;AAChB,UAAM,cAAc,oBAAI,I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;AAChF,SAAO,OAAO,WAAW;AAC3B;;;ACKO,SAAS,UACd,QACAC,SACA,OACmC;AAEnC,QAAM,aAAa,QAAQ,OAAO,QAAQ,KAAK,EAAE;AAAA,IAAI,CAAC,CAAC,KAAK,IAAI,OAC9D;AAAA,MACE,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,GAAG,KAAK,OAAO;AAAA,IACjB;AAAA,EACF,IAAI,CAAC;AACL,QAAM,kBAAkB,QAAQ,OAAO,QAAQ,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,MAAM;AACjF,QAAI,GAAG,IAAI,KAAK,WAAW;AAC3B,WAAO;AAAA,EACT,GAAG,CAAC,CAAkF,IAAI,CAAC;AAE3F,SAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAAA;AAAA,IACA,SAAS;AACP,aAAO;AAAA,QACL,GAAG;AAAA,QACH,GAAGA,QAAO,OAAO;AAAA,QACjB,cAAc;AAAA,MAChB;AAAA,IACF;AAAA,IACA,aAAa;AACX,aAAO;AAAA,QACL,GAAGA,QAAO,WAAW;AAAA,QACrB,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IACA,GAAG;AAAA,EACL;AACF;;;AJrCO,SAAS,aAAsC,QAA0B,SAAuB;AACrG,QAAM,QAA2D,SAAS;AAAA,IACxE,GAAG,gBAAgB,MAAM;AAAA,EAC3B,IAAI;AAEJ,SAAO,CAAoBC,eAAsC;AAC/D,UAAM,OAAO,cAAcA,WAAU,WAAY;AAEjD,QAAI,CAAC,OAAO,eAAe,IAAI,IAAI,GAAG;AACpC,qBAAe;AAAA,QACb;AAAA,YACA,8BAAAC,SAAKD,YAAW;AAAA,UACd;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;","names":["field","dialog","dialog","component","r2wc"]}
|
package/dist/index.mjs
CHANGED
|
@@ -62,6 +62,11 @@ function addConditionToField(fields, path, condition) {
|
|
|
62
62
|
if (!field.children) {
|
|
63
63
|
throw new Error(`Field with id "${key}" has no children`);
|
|
64
64
|
}
|
|
65
|
+
const nextKey = keys[i + 1];
|
|
66
|
+
if (nextKey === "$this") {
|
|
67
|
+
field.condition = condition;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
65
70
|
currentFields = field.children;
|
|
66
71
|
}
|
|
67
72
|
}
|