@rohal12/spindle 0.64.23 → 0.64.25
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/dist/pkg/format.js +1 -1
- package/dist/pkg/headless.js +534 -218
- package/dist/pkg/story-variables.js +375 -174
- package/package.json +1 -1
- package/src/components/Passage.tsx +43 -17
- package/src/components/macros/Computed.tsx +8 -3
- package/src/components/macros/Goto.tsx +5 -0
- package/src/components/macros/Include.tsx +6 -2
- package/src/components/macros/MacroError.tsx +7 -2
- package/src/components/macros/PassageDisplay.tsx +75 -17
- package/src/components/macros/SaveManager.tsx +79 -3
- package/src/hooks/use-story-fields.ts +13 -0
- package/src/markup/spindle.peggy +27 -14
- package/src/observe/observable-text.ts +26 -8
- package/src/styles.css +19 -0
- package/src/utils/element-visibility.ts +13 -0
package/src/styles.css
CHANGED
|
@@ -573,6 +573,25 @@ tw-storydata {
|
|
|
573
573
|
background: rgba(239, 83, 80, 0.1);
|
|
574
574
|
}
|
|
575
575
|
|
|
576
|
+
.save-slot-action.danger.is-armed {
|
|
577
|
+
color: #ef5350;
|
|
578
|
+
background: rgba(239, 83, 80, 0.15);
|
|
579
|
+
border-color: rgba(239, 83, 80, 0.5);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/* Read by screen readers, not shown: announces an armed Delete button */
|
|
583
|
+
.saves-sr-only {
|
|
584
|
+
position: absolute;
|
|
585
|
+
width: 1px;
|
|
586
|
+
height: 1px;
|
|
587
|
+
margin: -1px;
|
|
588
|
+
padding: 0;
|
|
589
|
+
overflow: hidden;
|
|
590
|
+
clip: rect(0, 0, 0, 0);
|
|
591
|
+
white-space: nowrap;
|
|
592
|
+
border: 0;
|
|
593
|
+
}
|
|
594
|
+
|
|
576
595
|
.save-slot-new {
|
|
577
596
|
display: flex;
|
|
578
597
|
align-items: center;
|
|
@@ -35,6 +35,17 @@ export function* composedElements(root: ParentNode): Generator<HTMLElement> {
|
|
|
35
35
|
|
|
36
36
|
/** Elements whose content is never text the reader reads. */
|
|
37
37
|
const NOT_TEXT = new Set(['script', 'style', 'template', 'noscript']);
|
|
38
|
+
const SVG_NOT_TEXT = new Set([
|
|
39
|
+
'title',
|
|
40
|
+
'desc',
|
|
41
|
+
'metadata',
|
|
42
|
+
'defs',
|
|
43
|
+
'symbol',
|
|
44
|
+
'clippath',
|
|
45
|
+
'mask',
|
|
46
|
+
'pattern',
|
|
47
|
+
'marker',
|
|
48
|
+
]);
|
|
38
49
|
|
|
39
50
|
/**
|
|
40
51
|
* Whether the element hides its whole subtree, including stylesheet rules.
|
|
@@ -47,6 +58,8 @@ export function isHidden(el: Element): boolean {
|
|
|
47
58
|
/(^|;)\s*display\s*:\s*none\b/i.test(el.getAttribute('style') ?? '') ||
|
|
48
59
|
el.ownerDocument.defaultView?.getComputedStyle(el).display === 'none' ||
|
|
49
60
|
NOT_TEXT.has(el.localName.toLowerCase()) ||
|
|
61
|
+
(el.namespaceURI === 'http://www.w3.org/2000/svg' &&
|
|
62
|
+
SVG_NOT_TEXT.has(el.localName.toLowerCase())) ||
|
|
50
63
|
(el.parentElement?.tagName === 'DETAILS' &&
|
|
51
64
|
!el.parentElement.hasAttribute('open') &&
|
|
52
65
|
el !==
|