@lostgradient/cinder 0.24.5 → 0.24.6
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/CHANGELOG.md +8 -0
- package/components.json +1 -1
- package/dist/components/json-schema-editor/index.js +100 -50
- package/dist/components/json-schema-editor/json-schema-editor.css +4 -0
- package/dist/index.js +193 -143
- package/dist/server/components/json-schema-editor/index.js +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/{index.server-tb414d8x.js → index.server-4entcat5.js} +59 -20
- package/package.json +1 -1
- package/src/components/json-schema-editor/json-schema-editor.css +4 -0
- package/src/components/json-schema-editor/property-list.svelte +64 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @lostgradient/cinder
|
|
2
2
|
|
|
3
|
+
## 0.24.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1345](https://github.com/stevekinney/cinder/pull/1345) [`338a673`](https://github.com/stevekinney/cinder/commit/338a673a546b9322bdce78cf8465debd187c178d) Thanks [@stevekinney](https://github.com/stevekinney)! - Detect CSS duplication for compound child components authored in parent stylesheets.
|
|
8
|
+
|
|
9
|
+
- [#1344](https://github.com/stevekinney/cinder/pull/1344) [`bdf4af3`](https://github.com/stevekinney/cinder/commit/bdf4af36aa5e434855e2544e7b61a7bb0d2d051b) Thanks [@stevekinney](https://github.com/stevekinney)! - Exclude CSS variables explicitly marked `@runtime-state` from the public override manifest.
|
|
10
|
+
|
|
3
11
|
## 0.24.5
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/components.json
CHANGED
|
@@ -2864,7 +2864,7 @@ function Chevron_down($$anchor, $$props) {
|
|
|
2864
2864
|
}));
|
|
2865
2865
|
}
|
|
2866
2866
|
// src/components/json-schema-editor/property-list.svelte
|
|
2867
|
-
import { onDestroy } from "svelte";
|
|
2867
|
+
import { onDestroy, tick as tick2 } from "svelte";
|
|
2868
2868
|
|
|
2869
2869
|
// src/components/chip/chip.svelte
|
|
2870
2870
|
import"svelte/internal/disclose-version";
|
|
@@ -3074,7 +3074,7 @@ var root17 = $26.from_html(`<p class="cinder-jse-property-list__empty">No proper
|
|
|
3074
3074
|
var root_112 = $26.from_html(`<div class="cinder-jse-property-row__panel"><!> <!></div>`);
|
|
3075
3075
|
var root_29 = $26.from_html(`<div class="cinder-jse-property-row"><div class="cinder-jse-property-row__summary"><button type="button" class="cinder-jse-property-row__trigger"><!> <span class="cinder-jse-property-row__name"> </span> <span class="cinder-jse-property-row__type"> </span> <!></button> <span class="cinder-jse-property-row__spacer"></span> <!> <!> <!> <!></div> <!></div>`);
|
|
3076
3076
|
var root_37 = $26.from_html(`<div class="cinder-jse-required-only__panel"><!> <!> <!></div>`);
|
|
3077
|
-
var root_45 = $26.from_html(`<div class="cinder-jse-property-list"><!> <!> <!>
|
|
3077
|
+
var root_45 = $26.from_html(`<p class="cinder-sr-only" aria-live="polite"> </p> <div class="cinder-jse-property-list"><!> <!> <!> <span class="cinder-jse-property-list__add-property-reference"><!></span> <!></div>`, 1);
|
|
3078
3078
|
function Property_list($$anchor, $$props) {
|
|
3079
3079
|
$26.push($$props, true);
|
|
3080
3080
|
let depth = $26.prop($$props, "depth", 3, 0), readonly = $26.prop($$props, "readonly", 3, false);
|
|
@@ -3120,7 +3120,7 @@ function Property_list($$anchor, $$props) {
|
|
|
3120
3120
|
return;
|
|
3121
3121
|
}
|
|
3122
3122
|
$26.set(renameError, null);
|
|
3123
|
-
const next4 =
|
|
3123
|
+
const next4 = Object.create(null);
|
|
3124
3124
|
for (const k of $26.get(propertyNames)) {
|
|
3125
3125
|
next4[k === oldKey ? draft : k] = $$props.properties[k];
|
|
3126
3126
|
}
|
|
@@ -3137,9 +3137,33 @@ function Property_list($$anchor, $$props) {
|
|
|
3137
3137
|
}
|
|
3138
3138
|
$$props.onValueChange(next4, nextRequired);
|
|
3139
3139
|
}
|
|
3140
|
-
|
|
3140
|
+
let actionAnnouncement = $26.state("");
|
|
3141
|
+
const propertyTriggerElements = new Map;
|
|
3142
|
+
let addPropertyElement = $26.state(undefined);
|
|
3143
|
+
function propertyTrigger(element3, key) {
|
|
3144
|
+
propertyTriggerElements.set(key, element3);
|
|
3145
|
+
return {
|
|
3146
|
+
update(nextKey) {
|
|
3147
|
+
if (nextKey === key)
|
|
3148
|
+
return;
|
|
3149
|
+
propertyTriggerElements.delete(key);
|
|
3150
|
+
key = nextKey;
|
|
3151
|
+
propertyTriggerElements.set(key, element3);
|
|
3152
|
+
},
|
|
3153
|
+
destroy() {
|
|
3154
|
+
propertyTriggerElements.delete(key);
|
|
3155
|
+
}
|
|
3156
|
+
};
|
|
3157
|
+
}
|
|
3158
|
+
async function announceAction(message) {
|
|
3159
|
+
$26.set(actionAnnouncement, "");
|
|
3160
|
+
await tick2();
|
|
3161
|
+
$26.set(actionAnnouncement, message, true);
|
|
3162
|
+
}
|
|
3163
|
+
async function deleteProperty(key, index3) {
|
|
3141
3164
|
if (readonly())
|
|
3142
3165
|
return;
|
|
3166
|
+
const focusKey = $26.get(propertyNames)[index3 + 1] ?? $26.get(propertyNames)[index3 - 1];
|
|
3143
3167
|
const next4 = { ...$$props.properties };
|
|
3144
3168
|
delete next4[key];
|
|
3145
3169
|
const nextRequired = $$props.required.filter((name) => name !== key);
|
|
@@ -3148,6 +3172,10 @@ function Property_list($$anchor, $$props) {
|
|
|
3148
3172
|
const { [key]: _removedChildCount, ...remainingChildCounts } = $26.get(childValidationCounts);
|
|
3149
3173
|
$26.set(childValidationCounts, remainingChildCounts, true);
|
|
3150
3174
|
$$props.onValueChange(next4, nextRequired);
|
|
3175
|
+
await announceAction(`Deleted ${key} property.`);
|
|
3176
|
+
await tick2();
|
|
3177
|
+
const focusTarget = focusKey ? propertyTriggerElements.get(focusKey) : $26.get(addPropertyElement)?.querySelector("button");
|
|
3178
|
+
focusTarget?.focus();
|
|
3151
3179
|
}
|
|
3152
3180
|
function setChildValidationErrorCount(key, count) {
|
|
3153
3181
|
if (($26.get(childValidationCounts)[key] ?? 0) === count)
|
|
@@ -3164,19 +3192,30 @@ function Property_list($$anchor, $$props) {
|
|
|
3164
3192
|
if (isOpen)
|
|
3165
3193
|
setChildValidationErrorCount(key, 0);
|
|
3166
3194
|
}
|
|
3167
|
-
function moveProperty(key, direction) {
|
|
3168
|
-
if (readonly())
|
|
3195
|
+
async function moveProperty(key, direction, index3) {
|
|
3196
|
+
if (readonly() || !canMoveProperty(index3, direction))
|
|
3169
3197
|
return;
|
|
3170
|
-
const index3 = $26.get(propertyNames).indexOf(key);
|
|
3171
3198
|
const target = index3 + direction;
|
|
3172
3199
|
if (target < 0 || target >= $26.get(propertyNames).length)
|
|
3173
3200
|
return;
|
|
3174
3201
|
const reordered = [...$26.get(propertyNames)];
|
|
3175
3202
|
[reordered[index3], reordered[target]] = [reordered[target], reordered[index3]];
|
|
3176
|
-
const next4 =
|
|
3203
|
+
const next4 = Object.create(null);
|
|
3177
3204
|
for (const name of reordered)
|
|
3178
3205
|
next4[name] = $$props.properties[name];
|
|
3179
3206
|
$$props.onValueChange(next4, $$props.required);
|
|
3207
|
+
await announceAction(`Moved ${key} property to position ${target + 1} of ${reordered.length}.`);
|
|
3208
|
+
}
|
|
3209
|
+
function canMoveProperty(index3, direction) {
|
|
3210
|
+
const target = index3 + direction;
|
|
3211
|
+
if (target < 0 || target >= $26.get(propertyNames).length)
|
|
3212
|
+
return false;
|
|
3213
|
+
const reordered = [...$26.get(propertyNames)];
|
|
3214
|
+
[reordered[index3], reordered[target]] = [reordered[target], reordered[index3]];
|
|
3215
|
+
const next4 = Object.create(null);
|
|
3216
|
+
for (const name of reordered)
|
|
3217
|
+
next4[name] = $$props.properties[name];
|
|
3218
|
+
return Object.keys(next4).every((name, nextIndex) => name === reordered[nextIndex]);
|
|
3180
3219
|
}
|
|
3181
3220
|
function toggleRequired(key) {
|
|
3182
3221
|
if (readonly())
|
|
@@ -3231,7 +3270,11 @@ function Property_list($$anchor, $$props) {
|
|
|
3231
3270
|
return;
|
|
3232
3271
|
$$props.onValueChange($$props.properties, $$props.required.filter((entry) => entry !== name));
|
|
3233
3272
|
}
|
|
3234
|
-
var
|
|
3273
|
+
var fragment = root_45();
|
|
3274
|
+
var p = $26.first_child(fragment);
|
|
3275
|
+
var text6 = $26.child(p, true);
|
|
3276
|
+
$26.reset(p);
|
|
3277
|
+
var div = $26.sibling(p, 2);
|
|
3235
3278
|
var node = $26.child(div);
|
|
3236
3279
|
{
|
|
3237
3280
|
var consequent = ($$anchor2) => {
|
|
@@ -3239,9 +3282,9 @@ function Property_list($$anchor, $$props) {
|
|
|
3239
3282
|
variant: "danger",
|
|
3240
3283
|
children: ($$anchor3, $$slotProps) => {
|
|
3241
3284
|
$26.next();
|
|
3242
|
-
var
|
|
3243
|
-
$26.template_effect(() => $26.set_text(
|
|
3244
|
-
$26.append($$anchor3,
|
|
3285
|
+
var text_1 = $26.text();
|
|
3286
|
+
$26.template_effect(() => $26.set_text(text_1, $26.get(renameError)));
|
|
3287
|
+
$26.append($$anchor3, text_1);
|
|
3245
3288
|
},
|
|
3246
3289
|
$$slots: { default: true }
|
|
3247
3290
|
});
|
|
@@ -3254,8 +3297,8 @@ function Property_list($$anchor, $$props) {
|
|
|
3254
3297
|
var node_1 = $26.sibling(node, 2);
|
|
3255
3298
|
{
|
|
3256
3299
|
var consequent_1 = ($$anchor2) => {
|
|
3257
|
-
var
|
|
3258
|
-
$26.append($$anchor2,
|
|
3300
|
+
var p_1 = root17();
|
|
3301
|
+
$26.append($$anchor2, p_1);
|
|
3259
3302
|
};
|
|
3260
3303
|
$26.if(node_1, ($$render) => {
|
|
3261
3304
|
if ($26.get(propertyNames).length === 0)
|
|
@@ -3263,7 +3306,7 @@ function Property_list($$anchor, $$props) {
|
|
|
3263
3306
|
});
|
|
3264
3307
|
}
|
|
3265
3308
|
var node_2 = $26.sibling(node_1, 2);
|
|
3266
|
-
$26.each(node_2,
|
|
3309
|
+
$26.each(node_2, 18, () => $26.get(propertyNames), (key) => key, ($$anchor2, key, index3) => {
|
|
3267
3310
|
const isRequired = $26.derived(() => $$props.required.includes(key));
|
|
3268
3311
|
const isOpen = $26.derived(() => expanded[key] === true);
|
|
3269
3312
|
const childValidationErrorCount = $26.derived(() => $26.get(childValidationCounts)[key] ?? 0);
|
|
@@ -3279,10 +3322,10 @@ function Property_list($$anchor, $$props) {
|
|
|
3279
3322
|
"aria-hidden": "true"
|
|
3280
3323
|
});
|
|
3281
3324
|
var span = $26.sibling(node_3, 2);
|
|
3282
|
-
var
|
|
3325
|
+
var text_2 = $26.child(span, true);
|
|
3283
3326
|
$26.reset(span);
|
|
3284
3327
|
var span_1 = $26.sibling(span, 2);
|
|
3285
|
-
var
|
|
3328
|
+
var text_3 = $26.child(span_1, true);
|
|
3286
3329
|
$26.reset(span_1);
|
|
3287
3330
|
var node_4 = $26.sibling(span_1, 2);
|
|
3288
3331
|
{
|
|
@@ -3296,10 +3339,10 @@ function Property_list($$anchor, $$props) {
|
|
|
3296
3339
|
},
|
|
3297
3340
|
children: ($$anchor4, $$slotProps) => {
|
|
3298
3341
|
$26.next();
|
|
3299
|
-
var
|
|
3300
|
-
$26.template_effect(() => $26.set_text(
|
|
3342
|
+
var text_4 = $26.text();
|
|
3343
|
+
$26.template_effect(() => $26.set_text(text_4, `${$26.get(childValidationErrorCount) ?? ""}
|
|
3301
3344
|
${$26.get(childValidationErrorCount) === 1 ? "error" : "errors"}`));
|
|
3302
|
-
$26.append($$anchor4,
|
|
3345
|
+
$26.append($$anchor4, text_4);
|
|
3303
3346
|
},
|
|
3304
3347
|
$$slots: { default: true }
|
|
3305
3348
|
});
|
|
@@ -3311,10 +3354,11 @@ function Property_list($$anchor, $$props) {
|
|
|
3311
3354
|
});
|
|
3312
3355
|
}
|
|
3313
3356
|
$26.reset(button);
|
|
3357
|
+
$26.action(button, ($$node, $$action_arg) => propertyTrigger?.($$node, $$action_arg), () => key);
|
|
3314
3358
|
var node_5 = $26.sibling(button, 4);
|
|
3315
3359
|
{
|
|
3316
3360
|
let $0 = $26.derived(() => $26.get(isRequired) ? "primary" : "ghost");
|
|
3317
|
-
let $1 = $26.derived(() => $26.get(isRequired) ? "Required (toggle off)" : "Optional (toggle required)");
|
|
3361
|
+
let $1 = $26.derived(() => `${key}: ${$26.get(isRequired) ? "Required (toggle off)" : "Optional (toggle required)"}`);
|
|
3318
3362
|
Button(node_5, {
|
|
3319
3363
|
get variant() {
|
|
3320
3364
|
return $26.get($0);
|
|
@@ -3332,51 +3376,53 @@ function Property_list($$anchor, $$props) {
|
|
|
3332
3376
|
onclick: () => toggleRequired(key),
|
|
3333
3377
|
children: ($$anchor3, $$slotProps) => {
|
|
3334
3378
|
$26.next();
|
|
3335
|
-
var
|
|
3336
|
-
$26.template_effect(() => $26.set_text(
|
|
3337
|
-
$26.append($$anchor3,
|
|
3379
|
+
var text_5 = $26.text();
|
|
3380
|
+
$26.template_effect(() => $26.set_text(text_5, $26.get(isRequired) ? "Required" : "Optional"));
|
|
3381
|
+
$26.append($$anchor3, text_5);
|
|
3338
3382
|
},
|
|
3339
3383
|
$$slots: { default: true }
|
|
3340
3384
|
});
|
|
3341
3385
|
}
|
|
3342
3386
|
var node_6 = $26.sibling(node_5, 2);
|
|
3343
3387
|
{
|
|
3344
|
-
let $0 = $26.derived(() =>
|
|
3388
|
+
let $0 = $26.derived(() => readonly() || !canMoveProperty($26.get(index3), -1));
|
|
3389
|
+
let $1 = $26.derived(() => `Move ${key} up`);
|
|
3345
3390
|
Button(node_6, {
|
|
3346
3391
|
variant: "ghost",
|
|
3347
3392
|
size: "xs",
|
|
3348
3393
|
get disabled() {
|
|
3349
|
-
return
|
|
3394
|
+
return $26.get($0);
|
|
3350
3395
|
},
|
|
3351
3396
|
get "aria-label"() {
|
|
3352
|
-
return $26.get($
|
|
3397
|
+
return $26.get($1);
|
|
3353
3398
|
},
|
|
3354
|
-
onclick: () => moveProperty(key, -1),
|
|
3399
|
+
onclick: () => moveProperty(key, -1, $26.get(index3)),
|
|
3355
3400
|
children: ($$anchor3, $$slotProps) => {
|
|
3356
3401
|
$26.next();
|
|
3357
|
-
var
|
|
3358
|
-
$26.append($$anchor3,
|
|
3402
|
+
var text_6 = $26.text("↑");
|
|
3403
|
+
$26.append($$anchor3, text_6);
|
|
3359
3404
|
},
|
|
3360
3405
|
$$slots: { default: true }
|
|
3361
3406
|
});
|
|
3362
3407
|
}
|
|
3363
3408
|
var node_7 = $26.sibling(node_6, 2);
|
|
3364
3409
|
{
|
|
3365
|
-
let $0 = $26.derived(() =>
|
|
3410
|
+
let $0 = $26.derived(() => readonly() || !canMoveProperty($26.get(index3), 1));
|
|
3411
|
+
let $1 = $26.derived(() => `Move ${key} down`);
|
|
3366
3412
|
Button(node_7, {
|
|
3367
3413
|
variant: "ghost",
|
|
3368
3414
|
size: "xs",
|
|
3369
3415
|
get disabled() {
|
|
3370
|
-
return
|
|
3416
|
+
return $26.get($0);
|
|
3371
3417
|
},
|
|
3372
3418
|
get "aria-label"() {
|
|
3373
|
-
return $26.get($
|
|
3419
|
+
return $26.get($1);
|
|
3374
3420
|
},
|
|
3375
|
-
onclick: () => moveProperty(key, 1),
|
|
3421
|
+
onclick: () => moveProperty(key, 1, $26.get(index3)),
|
|
3376
3422
|
children: ($$anchor3, $$slotProps) => {
|
|
3377
3423
|
$26.next();
|
|
3378
|
-
var
|
|
3379
|
-
$26.append($$anchor3,
|
|
3424
|
+
var text_7 = $26.text("↓");
|
|
3425
|
+
$26.append($$anchor3, text_7);
|
|
3380
3426
|
},
|
|
3381
3427
|
$$slots: { default: true }
|
|
3382
3428
|
});
|
|
@@ -3393,11 +3439,11 @@ function Property_list($$anchor, $$props) {
|
|
|
3393
3439
|
get "aria-label"() {
|
|
3394
3440
|
return $26.get($0);
|
|
3395
3441
|
},
|
|
3396
|
-
onclick: () => deleteProperty(key),
|
|
3442
|
+
onclick: () => deleteProperty(key, $26.get(index3)),
|
|
3397
3443
|
children: ($$anchor3, $$slotProps) => {
|
|
3398
3444
|
$26.next();
|
|
3399
|
-
var
|
|
3400
|
-
$26.append($$anchor3,
|
|
3445
|
+
var text_8 = $26.text("Delete");
|
|
3446
|
+
$26.append($$anchor3, text_8);
|
|
3401
3447
|
},
|
|
3402
3448
|
$$slots: { default: true }
|
|
3403
3449
|
});
|
|
@@ -3468,14 +3514,15 @@ function Property_list($$anchor, $$props) {
|
|
|
3468
3514
|
$26.set_style(div_2, `--cinder-jse-property-depth: ${depth()}`);
|
|
3469
3515
|
$26.set_attribute(button, "aria-label", `${$26.get(isOpen) ? "Collapse" : "Expand"} ${key} property${$26.get(childValidationErrorCount) > 0 ? `, ${$26.get(childValidationErrorCount)} validation ${$26.get(childValidationErrorCount) === 1 ? "error" : "errors"}` : ""}`);
|
|
3470
3516
|
$26.set_attribute(button, "aria-expanded", $26.get(isOpen));
|
|
3471
|
-
$26.set_attribute(button, "aria-controls", $26.get(panelId));
|
|
3472
|
-
$26.set_text(
|
|
3473
|
-
$26.set_text(
|
|
3517
|
+
$26.set_attribute(button, "aria-controls", $26.get(isOpen) ? $26.get(panelId) : undefined);
|
|
3518
|
+
$26.set_text(text_2, key);
|
|
3519
|
+
$26.set_text(text_3, $0);
|
|
3474
3520
|
}, [() => summariseType($$props.properties[key] ?? {})]);
|
|
3475
3521
|
$26.delegated("click", button, () => toggleExpanded(key, $26.get(isOpen)));
|
|
3476
3522
|
$26.append($$anchor2, div_1);
|
|
3477
3523
|
});
|
|
3478
|
-
var
|
|
3524
|
+
var span_2 = $26.sibling(node_2, 2);
|
|
3525
|
+
var node_12 = $26.child(span_2);
|
|
3479
3526
|
Button(node_12, {
|
|
3480
3527
|
variant: "secondary",
|
|
3481
3528
|
size: "sm",
|
|
@@ -3485,12 +3532,14 @@ function Property_list($$anchor, $$props) {
|
|
|
3485
3532
|
onclick: addProperty,
|
|
3486
3533
|
children: ($$anchor2, $$slotProps) => {
|
|
3487
3534
|
$26.next();
|
|
3488
|
-
var
|
|
3489
|
-
$26.append($$anchor2,
|
|
3535
|
+
var text_9 = $26.text("Add property");
|
|
3536
|
+
$26.append($$anchor2, text_9);
|
|
3490
3537
|
},
|
|
3491
3538
|
$$slots: { default: true }
|
|
3492
3539
|
});
|
|
3493
|
-
|
|
3540
|
+
$26.reset(span_2);
|
|
3541
|
+
$26.bind_this(span_2, ($$value) => $26.set(addPropertyElement, $$value), () => $26.get(addPropertyElement));
|
|
3542
|
+
var node_13 = $26.sibling(span_2, 2);
|
|
3494
3543
|
{
|
|
3495
3544
|
var consequent_4 = ($$anchor2) => {
|
|
3496
3545
|
{
|
|
@@ -3552,8 +3601,8 @@ function Property_list($$anchor, $$props) {
|
|
|
3552
3601
|
onclick: addRequiredOnly,
|
|
3553
3602
|
children: ($$anchor4, $$slotProps2) => {
|
|
3554
3603
|
$26.next();
|
|
3555
|
-
var
|
|
3556
|
-
$26.append($$anchor4,
|
|
3604
|
+
var text_10 = $26.text("Add required name");
|
|
3605
|
+
$26.append($$anchor4, text_10);
|
|
3557
3606
|
},
|
|
3558
3607
|
$$slots: { default: true }
|
|
3559
3608
|
});
|
|
@@ -3570,7 +3619,8 @@ function Property_list($$anchor, $$props) {
|
|
|
3570
3619
|
});
|
|
3571
3620
|
}
|
|
3572
3621
|
$26.reset(div);
|
|
3573
|
-
$26.
|
|
3622
|
+
$26.template_effect(() => $26.set_text(text6, $26.get(actionAnnouncement)));
|
|
3623
|
+
$26.append($$anchor, fragment);
|
|
3574
3624
|
$26.pop();
|
|
3575
3625
|
}
|
|
3576
3626
|
$26.delegate(["click"]);
|
|
@@ -6384,4 +6434,4 @@ export {
|
|
|
6384
6434
|
Json_schema_editor as JsonSchemaEditor
|
|
6385
6435
|
};
|
|
6386
6436
|
|
|
6387
|
-
//# debugId=
|
|
6437
|
+
//# debugId=F7B2AF198239514F64756E2164756E21
|