@talqui-oss/template-builder 0.0.0-stage → 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/dist/adapters/meta.cjs +242 -0
- package/dist/adapters/meta.d.cts +15 -0
- package/dist/adapters/meta.d.ts +15 -0
- package/dist/adapters/meta.js +185 -0
- package/dist/adapters/talqui.cjs +263 -0
- package/dist/adapters/talqui.d.cts +19 -0
- package/dist/adapters/talqui.d.ts +19 -0
- package/dist/adapters/talqui.js +206 -0
- package/dist/adapters/twilio.cjs +215 -0
- package/dist/adapters/twilio.d.cts +16 -0
- package/dist/adapters/twilio.d.ts +16 -0
- package/dist/adapters/twilio.js +124 -0
- package/dist/chunk-SMN4WTO3.js +46 -0
- package/dist/chunk-ULTGMISN.js +70 -0
- package/dist/editor.css +274 -0
- package/dist/index.cjs +1855 -0
- package/dist/index.d.cts +315 -0
- package/dist/index.d.ts +315 -0
- package/dist/index.js +1743 -0
- package/dist/schema.json +689 -0
- package/dist/styles.css +267 -0
- package/dist/types-CRH48UOs.d.cts +194 -0
- package/dist/types-CRH48UOs.d.ts +194 -0
- package/package.json +60 -3
- package/README.md +0 -3
package/dist/editor.css
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Styles for <TemplateEditor>. Import once: `@talqui-oss/template-builder/editor.css`.
|
|
3
|
+
* Theme it by overriding the custom properties on `.tb-editor` (or any ancestor).
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.tb-editor {
|
|
7
|
+
--tb-editor-font: system-ui, -apple-system, "Segoe UI", sans-serif;
|
|
8
|
+
--tb-editor-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
9
|
+
--tb-editor-text: #1c1c1c;
|
|
10
|
+
--tb-editor-muted: #6b6b6b;
|
|
11
|
+
--tb-editor-faint: #9a9a9a;
|
|
12
|
+
--tb-editor-surface: #ffffff;
|
|
13
|
+
--tb-editor-control: #ffffff;
|
|
14
|
+
--tb-editor-hover: #f2f2f2;
|
|
15
|
+
--tb-editor-border: #e6e6e6;
|
|
16
|
+
--tb-editor-border-strong: #d4d4d4;
|
|
17
|
+
--tb-editor-accent: #1f8f4e;
|
|
18
|
+
--tb-editor-radius: 14px;
|
|
19
|
+
--tb-editor-radius-control: 7px;
|
|
20
|
+
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
gap: 16px;
|
|
24
|
+
color: var(--tb-editor-text);
|
|
25
|
+
font: 14px/1.5 var(--tb-editor-font);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.tb-editor *,
|
|
29
|
+
.tb-editor *::before,
|
|
30
|
+
.tb-editor *::after {
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Sections */
|
|
35
|
+
|
|
36
|
+
.tb-editor__section {
|
|
37
|
+
border: 1px solid var(--tb-editor-border);
|
|
38
|
+
border-radius: var(--tb-editor-radius);
|
|
39
|
+
background: var(--tb-editor-surface);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.tb-editor__title {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: baseline;
|
|
45
|
+
gap: 10px;
|
|
46
|
+
min-height: 52px;
|
|
47
|
+
margin: 0;
|
|
48
|
+
padding: 16px 20px 14px;
|
|
49
|
+
border-bottom: 1px solid var(--tb-editor-border);
|
|
50
|
+
font-size: 14px;
|
|
51
|
+
font-weight: 600;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.tb-editor__index {
|
|
55
|
+
color: var(--tb-editor-faint);
|
|
56
|
+
font: 12px var(--tb-editor-mono);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.tb-editor__body {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
gap: 16px;
|
|
63
|
+
padding: 20px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.tb-editor__note {
|
|
67
|
+
margin: -8px 0 0;
|
|
68
|
+
color: var(--tb-editor-faint);
|
|
69
|
+
font-size: 12px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Rows: fields side by side, wrapping on narrow widths. */
|
|
73
|
+
|
|
74
|
+
.tb-editor__row {
|
|
75
|
+
display: grid;
|
|
76
|
+
/* 220px fits the three category labels; narrower rows stack their fields. */
|
|
77
|
+
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
|
78
|
+
gap: 16px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* A button in the list: type, one or two values, remove. Labels are kept for screen readers only. */
|
|
82
|
+
.tb-editor__row--list {
|
|
83
|
+
display: flex;
|
|
84
|
+
gap: 8px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.tb-editor__row--list > .tb-editor__field {
|
|
88
|
+
flex: 1 1 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.tb-editor__row--list > .tb-editor__field:first-child {
|
|
92
|
+
flex: 0 0 132px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.tb-editor__row--list > .tb-editor__action {
|
|
96
|
+
flex: 0 0 36px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.tb-editor__row--list .tb-editor__head {
|
|
100
|
+
position: absolute;
|
|
101
|
+
width: 1px;
|
|
102
|
+
height: 1px;
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
clip-path: inset(50%);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.tb-editor__field {
|
|
108
|
+
position: relative;
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
gap: 6px;
|
|
112
|
+
min-width: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.tb-editor__head {
|
|
116
|
+
display: flex;
|
|
117
|
+
justify-content: space-between;
|
|
118
|
+
gap: 8px;
|
|
119
|
+
/* One line only, so every control in a row starts at the same height. */
|
|
120
|
+
white-space: nowrap;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.tb-editor__label {
|
|
124
|
+
overflow: hidden;
|
|
125
|
+
text-overflow: ellipsis;
|
|
126
|
+
color: var(--tb-editor-muted);
|
|
127
|
+
font-size: 12px;
|
|
128
|
+
font-weight: 500;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.tb-editor__hint {
|
|
132
|
+
flex: none;
|
|
133
|
+
color: var(--tb-editor-faint);
|
|
134
|
+
font: 11px var(--tb-editor-mono);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Controls share one height: 18px line + 16px padding + 2px border = 36px. */
|
|
138
|
+
|
|
139
|
+
.tb-editor__input {
|
|
140
|
+
width: 100%;
|
|
141
|
+
min-height: 36px;
|
|
142
|
+
padding: 8px 10px;
|
|
143
|
+
border: 1px solid var(--tb-editor-border-strong);
|
|
144
|
+
border-radius: var(--tb-editor-radius-control);
|
|
145
|
+
background: var(--tb-editor-control);
|
|
146
|
+
color: var(--tb-editor-text);
|
|
147
|
+
font: inherit;
|
|
148
|
+
line-height: 18px;
|
|
149
|
+
outline: none;
|
|
150
|
+
transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.tb-editor__input:hover {
|
|
154
|
+
border-color: var(--tb-editor-faint);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.tb-editor__input:focus-visible {
|
|
158
|
+
border-color: var(--tb-editor-accent);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.tb-editor__input--mono {
|
|
162
|
+
font-family: var(--tb-editor-mono);
|
|
163
|
+
font-size: 13px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.tb-editor__input--area {
|
|
167
|
+
min-height: 140px;
|
|
168
|
+
resize: vertical;
|
|
169
|
+
line-height: 1.55;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.tb-editor__input--select {
|
|
173
|
+
appearance: none;
|
|
174
|
+
padding-right: 28px;
|
|
175
|
+
background-image:
|
|
176
|
+
linear-gradient(45deg, transparent 50%, currentColor 50%),
|
|
177
|
+
linear-gradient(135deg, currentColor 50%, transparent 50%);
|
|
178
|
+
background-position:
|
|
179
|
+
calc(100% - 15px) 50%,
|
|
180
|
+
calc(100% - 10px) 50%;
|
|
181
|
+
background-size: 5px 5px;
|
|
182
|
+
background-repeat: no-repeat;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.tb-editor__check {
|
|
186
|
+
display: flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
gap: 8px;
|
|
189
|
+
font-size: 13px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.tb-editor__check input {
|
|
193
|
+
accent-color: var(--tb-editor-accent);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* Segmented control, the same height as the inputs. */
|
|
197
|
+
|
|
198
|
+
.tb-editor__segment {
|
|
199
|
+
display: flex;
|
|
200
|
+
gap: 2px;
|
|
201
|
+
height: 36px;
|
|
202
|
+
padding: 2px;
|
|
203
|
+
border: 1px solid var(--tb-editor-border-strong);
|
|
204
|
+
border-radius: var(--tb-editor-radius-control);
|
|
205
|
+
background: var(--tb-editor-control);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* Items grow from their label width, so a long label gets the room it needs. */
|
|
209
|
+
.tb-editor__segment-item {
|
|
210
|
+
flex: 1 1 auto;
|
|
211
|
+
min-width: 0;
|
|
212
|
+
padding: 0 8px;
|
|
213
|
+
border: 0;
|
|
214
|
+
border-radius: 5px;
|
|
215
|
+
background: transparent;
|
|
216
|
+
color: var(--tb-editor-muted);
|
|
217
|
+
font: 500 12px var(--tb-editor-font);
|
|
218
|
+
white-space: nowrap;
|
|
219
|
+
overflow: hidden;
|
|
220
|
+
text-overflow: ellipsis;
|
|
221
|
+
cursor: pointer;
|
|
222
|
+
transition:
|
|
223
|
+
background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
|
|
224
|
+
color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.tb-editor__segment-item:hover {
|
|
228
|
+
color: var(--tb-editor-text);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.tb-editor__segment-item[aria-checked="true"] {
|
|
232
|
+
background: var(--tb-editor-hover);
|
|
233
|
+
color: var(--tb-editor-text);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.tb-editor__segment-item:focus-visible {
|
|
237
|
+
outline: 2px solid var(--tb-editor-accent);
|
|
238
|
+
outline-offset: 1px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/* Add and remove buttons */
|
|
242
|
+
|
|
243
|
+
.tb-editor__action {
|
|
244
|
+
min-height: 36px;
|
|
245
|
+
border: 1px solid var(--tb-editor-border-strong);
|
|
246
|
+
border-radius: var(--tb-editor-radius-control);
|
|
247
|
+
background: transparent;
|
|
248
|
+
color: var(--tb-editor-muted);
|
|
249
|
+
font: inherit;
|
|
250
|
+
cursor: pointer;
|
|
251
|
+
transition:
|
|
252
|
+
background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
|
|
253
|
+
color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.tb-editor__action:hover:not(:disabled) {
|
|
257
|
+
background: var(--tb-editor-hover);
|
|
258
|
+
color: var(--tb-editor-text);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.tb-editor__action--add {
|
|
262
|
+
grid-column: 1 / -1;
|
|
263
|
+
border-style: dashed;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.tb-editor__action--remove {
|
|
267
|
+
font-size: 18px;
|
|
268
|
+
line-height: 1;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.tb-editor__action:disabled {
|
|
272
|
+
opacity: 0.4;
|
|
273
|
+
cursor: default;
|
|
274
|
+
}
|