@dragcraft/renderer 0.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 +21 -0
- package/dist/index.d.mts +1419 -0
- package/dist/index.mjs +2590 -0
- package/dist/structure.css +383 -0
- package/package.json +54 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
.dc-root-renderer, .dc-container-shell, .dc-node-selection-plane, .dc-empty-state, .dc-node, .dc-node__mask, .dc-node__handle, .dc-node__handle-surface, .dc-node__handle-icon, .dc-node__handle-anchor, .dc-node__toolbar, .dc-node__toolbar-anchor, .dc-node__toolbar-btn, .dc-node__selection-projection, .dc-node__selection-outline, .dc-node__selection-edge, .dc-drop-indicator, .dc-widget-fallback, .dc-forbidden-overlay, .dc-forbidden-overlay__text {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.dc-node__selection-outline {
|
|
6
|
+
border: var(--dc-node-selection-stroke-width, 2px) solid transparent;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.dc-drop-indicator {
|
|
10
|
+
border: 2px dashed #0000;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.dc-widget-fallback {
|
|
14
|
+
border: 1px dashed #0000;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.dc-forbidden-overlay {
|
|
18
|
+
border: 2px dashed #0000;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.dc-forbidden-overlay__text {
|
|
22
|
+
border: 1px solid #0000;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.dc-root-renderer {
|
|
26
|
+
min-height: 100%;
|
|
27
|
+
position: relative;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.dc-container-shell {
|
|
31
|
+
isolation: isolate;
|
|
32
|
+
grid-template-rows: var(--dc-inset-block-start) minmax(0, 1fr) var(--dc-inset-block-end);
|
|
33
|
+
grid-template-columns: var(--dc-inset-inline-start) minmax(0, 1fr) var(--dc-inset-inline-end);
|
|
34
|
+
--dc-sized-inset-block-start: 0px;
|
|
35
|
+
--dc-sized-inset-block-end: 0px;
|
|
36
|
+
--dc-sized-inset-inline-start: 0px;
|
|
37
|
+
--dc-sized-inset-inline-end: 0px;
|
|
38
|
+
--dc-measured-inset-block-start: 0px;
|
|
39
|
+
--dc-measured-inset-block-end: 0px;
|
|
40
|
+
--dc-measured-inset-inline-start: 0px;
|
|
41
|
+
--dc-measured-inset-inline-end: 0px;
|
|
42
|
+
--dc-inset-block-start: calc(var(--dc-sized-inset-block-start) + var(--dc-measured-inset-block-start));
|
|
43
|
+
--dc-inset-block-end: calc(var(--dc-sized-inset-block-end) + var(--dc-measured-inset-block-end));
|
|
44
|
+
--dc-inset-inline-start: calc(var(--dc-sized-inset-inline-start) + var(--dc-measured-inset-inline-start));
|
|
45
|
+
--dc-inset-inline-end: calc(var(--dc-sized-inset-inline-end) + var(--dc-measured-inset-inline-end));
|
|
46
|
+
min-height: 200px;
|
|
47
|
+
display: grid;
|
|
48
|
+
position: relative;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.dc-node-selection-plane {
|
|
52
|
+
z-index: 40;
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
position: absolute;
|
|
55
|
+
inset: 0;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.dc-container-shell--empty {
|
|
60
|
+
min-height: 200px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.dc-container-shell__content {
|
|
64
|
+
grid-area: 2 / 2;
|
|
65
|
+
min-width: 0;
|
|
66
|
+
min-height: 0;
|
|
67
|
+
overflow: auto;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.dc-container-shell__content-layout {
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
min-height: 100%;
|
|
73
|
+
display: flex;
|
|
74
|
+
position: relative;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.dc-container-shell__content-row {
|
|
78
|
+
flex: 1 0 auto;
|
|
79
|
+
grid-template-columns: max-content minmax(0, 1fr) max-content;
|
|
80
|
+
min-width: 0;
|
|
81
|
+
min-height: 100%;
|
|
82
|
+
display: grid;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.dc-container-shell__content-edge--inline-start {
|
|
86
|
+
grid-column: 1;
|
|
87
|
+
min-width: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.dc-container-shell__content-surface {
|
|
91
|
+
box-sizing: border-box;
|
|
92
|
+
grid-column: 2;
|
|
93
|
+
min-width: 0;
|
|
94
|
+
min-height: 100%;
|
|
95
|
+
position: relative;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.dc-container-shell__content-edge--inline-end {
|
|
99
|
+
grid-column: 3;
|
|
100
|
+
min-width: 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.dc-container-shell--empty > .dc-container-shell__content, .dc-container-shell--empty .dc-container-shell__content-layout, .dc-container-shell--empty .dc-container-shell__content-row, .dc-container-shell--empty .dc-container-shell__content-surface {
|
|
104
|
+
min-height: inherit;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.dc-container-shell--empty .dc-container-shell__content-surface {
|
|
108
|
+
justify-content: center;
|
|
109
|
+
align-items: center;
|
|
110
|
+
display: flex;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.dc-container-shell__layer-item--self > [data-dc-component="node"] {
|
|
114
|
+
pointer-events: none;
|
|
115
|
+
position: absolute;
|
|
116
|
+
inset: 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.dc-container-shell__layer-item--self > [data-dc-component="node"] > [data-dc-node-surface], .dc-container-shell__layer-item--self > [data-dc-component="node"] > :first-child {
|
|
120
|
+
pointer-events: auto;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.dc-empty-state {
|
|
124
|
+
pointer-events: none;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
align-items: center;
|
|
128
|
+
gap: 8px;
|
|
129
|
+
min-height: 160px;
|
|
130
|
+
display: flex;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.dc-empty-state__text {
|
|
134
|
+
pointer-events: none;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.dc-node {
|
|
138
|
+
cursor: default;
|
|
139
|
+
position: relative;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.dc-node--masked, .dc-node--unmasked {
|
|
143
|
+
position: relative;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.dc-node__mask {
|
|
147
|
+
z-index: 10;
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
pointer-events: auto;
|
|
150
|
+
position: absolute;
|
|
151
|
+
inset: 0;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.dc-node--unsorted {
|
|
155
|
+
cursor: default;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.dc-node__handle {
|
|
159
|
+
cursor: pointer;
|
|
160
|
+
border: 0;
|
|
161
|
+
margin: 0;
|
|
162
|
+
padding: 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.dc-node__handle-surface, .dc-node__handle-icon {
|
|
166
|
+
justify-content: center;
|
|
167
|
+
align-items: center;
|
|
168
|
+
display: flex;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.dc-node__handle-icon {
|
|
172
|
+
pointer-events: none;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.dc-node > .dc-node__handle {
|
|
176
|
+
z-index: 20;
|
|
177
|
+
pointer-events: none;
|
|
178
|
+
width: 28px;
|
|
179
|
+
height: 28px;
|
|
180
|
+
position: absolute;
|
|
181
|
+
top: 4px;
|
|
182
|
+
right: 4px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.dc-node > .dc-node__handle > .dc-node__handle-surface {
|
|
186
|
+
position: absolute;
|
|
187
|
+
inset: 2px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.dc-node--hovered > .dc-node__handle, .dc-node > .dc-node__handle:focus-visible {
|
|
191
|
+
pointer-events: auto;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.dc-node--selected > .dc-node__handle {
|
|
195
|
+
pointer-events: none;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.dc-node__handle:active > .dc-node__handle-surface {
|
|
199
|
+
transform: scale(.94);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.dc-node__handle-anchor {
|
|
203
|
+
z-index: 20;
|
|
204
|
+
pointer-events: none;
|
|
205
|
+
will-change: transform;
|
|
206
|
+
width: 32px;
|
|
207
|
+
height: 32px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.dc-node__handle-anchor--visible {
|
|
211
|
+
pointer-events: auto;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.dc-node__handle-anchor > .dc-node__handle {
|
|
215
|
+
width: 32px;
|
|
216
|
+
height: 32px;
|
|
217
|
+
position: relative;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.dc-node__handle-anchor > .dc-node__handle > .dc-node__handle-surface {
|
|
221
|
+
position: absolute;
|
|
222
|
+
inset: 4px;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.dc-node__toolbar {
|
|
226
|
+
z-index: 20;
|
|
227
|
+
flex-direction: column;
|
|
228
|
+
gap: 3px;
|
|
229
|
+
padding: 4px;
|
|
230
|
+
display: flex;
|
|
231
|
+
position: absolute;
|
|
232
|
+
top: 0;
|
|
233
|
+
right: -40px;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.dc-node__toolbar--vertical {
|
|
237
|
+
flex-direction: column;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.dc-node__toolbar--horizontal {
|
|
241
|
+
flex-flow: row;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.dc-node__toolbar-anchor {
|
|
245
|
+
z-index: 20;
|
|
246
|
+
pointer-events: auto;
|
|
247
|
+
will-change: transform;
|
|
248
|
+
overflow: auto;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.dc-node__toolbar-anchor[data-orientation="vertical"] {
|
|
252
|
+
overflow: hidden auto;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.dc-node__toolbar-anchor[data-orientation="horizontal"] {
|
|
256
|
+
overflow: auto hidden;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.dc-node__toolbar-btn {
|
|
260
|
+
cursor: pointer;
|
|
261
|
+
border: 0;
|
|
262
|
+
justify-content: center;
|
|
263
|
+
align-items: center;
|
|
264
|
+
width: 26px;
|
|
265
|
+
height: 26px;
|
|
266
|
+
padding: 0;
|
|
267
|
+
display: flex;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.dc-node__toolbar-btn:hover:not(:disabled, .dc-node__toolbar-btn--disabled) {
|
|
271
|
+
transform: translateY(-1px);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.dc-node__toolbar-btn:active:not(:disabled, .dc-node__toolbar-btn--disabled) {
|
|
275
|
+
transform: translateY(0);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.dc-node__toolbar-btn:disabled, .dc-node__toolbar-btn--disabled {
|
|
279
|
+
cursor: not-allowed;
|
|
280
|
+
pointer-events: none;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.dc-node__toolbar-btn--drag {
|
|
284
|
+
cursor: grab;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.dc-node__toolbar-btn--drag:active {
|
|
288
|
+
cursor: grabbing;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.dc-node__toolbar-btn--drag.dc-node__toolbar-btn--disabled {
|
|
292
|
+
cursor: not-allowed;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.dc-node__toolbar--floating {
|
|
296
|
+
pointer-events: auto;
|
|
297
|
+
position: static;
|
|
298
|
+
top: auto;
|
|
299
|
+
right: auto;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.dc-node__selection-projection {
|
|
303
|
+
z-index: 10;
|
|
304
|
+
pointer-events: none;
|
|
305
|
+
position: absolute;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.dc-node__selection-outline {
|
|
309
|
+
pointer-events: none;
|
|
310
|
+
position: absolute;
|
|
311
|
+
inset: 0;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.dc-node__selection-projection--root-segment > .dc-node__selection-outline {
|
|
315
|
+
border: 0;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.dc-node__selection-edge {
|
|
319
|
+
display: block;
|
|
320
|
+
position: absolute;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.dc-node__selection-edge--block-start, .dc-node__selection-edge--block-end {
|
|
324
|
+
height: var(--dc-node-selection-root-block-overlap, var(--dc-node-selection-stroke-width, 2px));
|
|
325
|
+
left: 0;
|
|
326
|
+
right: 0;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.dc-node__selection-edge--block-start {
|
|
330
|
+
bottom: 100%;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.dc-node__selection-edge--block-end {
|
|
334
|
+
top: 100%;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.dc-node__selection-edge--inline-start, .dc-node__selection-edge--inline-end {
|
|
338
|
+
top: calc(-1 * var(--dc-node-selection-root-block-overlap, var(--dc-node-selection-stroke-width, 2px)));
|
|
339
|
+
bottom: calc(-1 * var(--dc-node-selection-root-block-overlap, var(--dc-node-selection-stroke-width, 2px)));
|
|
340
|
+
width: var(--dc-node-selection-root-inline-overlap, var(--dc-node-selection-stroke-width, 2px));
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.dc-node__selection-edge--inline-start {
|
|
344
|
+
left: 0;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.dc-node__selection-edge--inline-end {
|
|
348
|
+
right: 0;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.dc-container-region--empty {
|
|
352
|
+
min-height: 32px;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.dc-drop-indicator {
|
|
356
|
+
pointer-events: none;
|
|
357
|
+
min-height: 48px;
|
|
358
|
+
margin: 4px 0;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.dc-widget-fallback {
|
|
362
|
+
text-align: center;
|
|
363
|
+
padding: 8px 12px;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.dc-forbidden-overlay {
|
|
367
|
+
z-index: 120;
|
|
368
|
+
pointer-events: none;
|
|
369
|
+
justify-content: center;
|
|
370
|
+
align-items: center;
|
|
371
|
+
min-height: 120px;
|
|
372
|
+
display: flex;
|
|
373
|
+
position: absolute;
|
|
374
|
+
inset: 0;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.dc-forbidden-overlay__text {
|
|
378
|
+
overflow-wrap: anywhere;
|
|
379
|
+
text-align: center;
|
|
380
|
+
white-space: normal;
|
|
381
|
+
max-width: min(280px, 100% - 32px);
|
|
382
|
+
padding: 6px 10px;
|
|
383
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dragcraft/renderer",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"description": "@dragcraft/renderer",
|
|
6
|
+
"author": "hackycy <hackycy@outlook.com>",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/hackycy/dragcraft#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/hackycy/dragcraft.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": "https://github.com/hackycy/dragcraft/issues",
|
|
14
|
+
"keywords": [],
|
|
15
|
+
"sideEffects": [
|
|
16
|
+
"**/*.css"
|
|
17
|
+
],
|
|
18
|
+
"exports": {
|
|
19
|
+
".": "./dist/index.mjs",
|
|
20
|
+
"./package.json": "./package.json",
|
|
21
|
+
"./structure.css": "./dist/structure.css"
|
|
22
|
+
},
|
|
23
|
+
"main": "./dist/index.mjs",
|
|
24
|
+
"module": "./dist/index.mjs",
|
|
25
|
+
"types": "./dist/index.d.mts",
|
|
26
|
+
"files": [
|
|
27
|
+
"dist"
|
|
28
|
+
],
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"vue": ">=3.0.0"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@floating-ui/dom": "^1.7.4",
|
|
34
|
+
"@dragcraft/core": "0.0.1",
|
|
35
|
+
"@dragcraft/i18n": "0.0.1",
|
|
36
|
+
"@dragcraft/utils": "0.0.1",
|
|
37
|
+
"@dragcraft/icons": "0.0.1"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"happy-dom": "^20.10.6",
|
|
41
|
+
"postcss": "^8.5.6",
|
|
42
|
+
"vitest": "^4.0.7",
|
|
43
|
+
"vue": "^3.5.27"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "tsdown",
|
|
47
|
+
"dev": "tsdown --watch",
|
|
48
|
+
"lint": "eslint",
|
|
49
|
+
"release": "bumpp",
|
|
50
|
+
"start": "tsx src/index.ts",
|
|
51
|
+
"test": "vitest",
|
|
52
|
+
"typecheck": "tsc"
|
|
53
|
+
}
|
|
54
|
+
}
|