@quillmark/svelte 0.0.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.
Files changed (143) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +58 -0
  3. package/README.md +241 -0
  4. package/THEMING.md +153 -0
  5. package/dist/core/address.d.ts +56 -0
  6. package/dist/core/address.js +95 -0
  7. package/dist/core/bloom.d.ts +37 -0
  8. package/dist/core/bloom.js +116 -0
  9. package/dist/core/codec/anchor.d.ts +19 -0
  10. package/dist/core/codec/anchor.js +36 -0
  11. package/dist/core/codec/code.d.ts +12 -0
  12. package/dist/core/codec/code.js +118 -0
  13. package/dist/core/codec/decode.d.ts +24 -0
  14. package/dist/core/codec/decode.js +270 -0
  15. package/dist/core/codec/encode.d.ts +71 -0
  16. package/dist/core/codec/encode.js +480 -0
  17. package/dist/core/codec/field.d.ts +171 -0
  18. package/dist/core/codec/field.js +493 -0
  19. package/dist/core/codec/index.d.ts +22 -0
  20. package/dist/core/codec/index.js +43 -0
  21. package/dist/core/codec/inputrules.d.ts +7 -0
  22. package/dist/core/codec/inputrules.js +168 -0
  23. package/dist/core/codec/islands.d.ts +36 -0
  24. package/dist/core/codec/islands.js +82 -0
  25. package/dist/core/codec/keymap.d.ts +13 -0
  26. package/dist/core/codec/keymap.js +29 -0
  27. package/dist/core/codec/lists.d.ts +22 -0
  28. package/dist/core/codec/lists.js +104 -0
  29. package/dist/core/codec/marks.d.ts +37 -0
  30. package/dist/core/codec/marks.js +74 -0
  31. package/dist/core/codec/positions.d.ts +17 -0
  32. package/dist/core/codec/positions.js +108 -0
  33. package/dist/core/codec/prose.css +458 -0
  34. package/dist/core/codec/reconcile.d.ts +26 -0
  35. package/dist/core/codec/reconcile.js +64 -0
  36. package/dist/core/codec/schema.d.ts +13 -0
  37. package/dist/core/codec/schema.js +155 -0
  38. package/dist/core/codec/slash.d.ts +79 -0
  39. package/dist/core/codec/slash.js +0 -0
  40. package/dist/core/codec/table-view.d.ts +50 -0
  41. package/dist/core/codec/table-view.js +928 -0
  42. package/dist/core/codec/table.d.ts +85 -0
  43. package/dist/core/codec/table.js +224 -0
  44. package/dist/core/errors.d.ts +73 -0
  45. package/dist/core/errors.js +24 -0
  46. package/dist/core/index.d.ts +5 -0
  47. package/dist/core/index.js +19 -0
  48. package/dist/core/lifecycle.d.ts +7 -0
  49. package/dist/core/lifecycle.js +21 -0
  50. package/dist/core/rebind.svelte.d.ts +18 -0
  51. package/dist/core/rebind.svelte.js +44 -0
  52. package/dist/core/teardown.d.ts +20 -0
  53. package/dist/core/teardown.js +37 -0
  54. package/dist/core/theme.css +276 -0
  55. package/dist/index.d.ts +1 -0
  56. package/dist/index.js +9 -0
  57. package/dist/preset/index.css +10 -0
  58. package/dist/preset/recipes.css +188 -0
  59. package/dist/preset/scale.css +97 -0
  60. package/dist/preview/Preview.svelte +118 -0
  61. package/dist/preview/Preview.svelte.d.ts +39 -0
  62. package/dist/preview/bridge.d.ts +13 -0
  63. package/dist/preview/bridge.js +88 -0
  64. package/dist/preview/controller.d.ts +40 -0
  65. package/dist/preview/controller.js +141 -0
  66. package/dist/preview/geometry.d.ts +37 -0
  67. package/dist/preview/geometry.js +45 -0
  68. package/dist/preview/index.d.ts +5 -0
  69. package/dist/preview/index.js +14 -0
  70. package/dist/preview/overlay.d.ts +10 -0
  71. package/dist/preview/overlay.js +82 -0
  72. package/dist/preview/paint.d.ts +17 -0
  73. package/dist/preview/paint.js +262 -0
  74. package/dist/preview/strings.d.ts +14 -0
  75. package/dist/preview/strings.js +22 -0
  76. package/dist/visual/ArrayField.svelte +362 -0
  77. package/dist/visual/ArrayField.svelte.d.ts +24 -0
  78. package/dist/visual/BooleanField.svelte +88 -0
  79. package/dist/visual/BooleanField.svelte.d.ts +20 -0
  80. package/dist/visual/Card.svelte +849 -0
  81. package/dist/visual/Card.svelte.d.ts +43 -0
  82. package/dist/visual/CardControls.svelte +92 -0
  83. package/dist/visual/CardControls.svelte.d.ts +11 -0
  84. package/dist/visual/DateField.svelte +203 -0
  85. package/dist/visual/DateField.svelte.d.ts +28 -0
  86. package/dist/visual/DiagnosticList.svelte +50 -0
  87. package/dist/visual/DiagnosticList.svelte.d.ts +7 -0
  88. package/dist/visual/EnumField.svelte +169 -0
  89. package/dist/visual/EnumField.svelte.d.ts +25 -0
  90. package/dist/visual/Field.svelte +270 -0
  91. package/dist/visual/Field.svelte.d.ts +37 -0
  92. package/dist/visual/FieldHint.svelte +185 -0
  93. package/dist/visual/FieldHint.svelte.d.ts +13 -0
  94. package/dist/visual/FieldLabel.svelte +141 -0
  95. package/dist/visual/FieldLabel.svelte.d.ts +19 -0
  96. package/dist/visual/FormatPopover.svelte +396 -0
  97. package/dist/visual/FormatPopover.svelte.d.ts +9 -0
  98. package/dist/visual/NumberField.svelte +72 -0
  99. package/dist/visual/NumberField.svelte.d.ts +19 -0
  100. package/dist/visual/ObjectField.svelte +131 -0
  101. package/dist/visual/ObjectField.svelte.d.ts +17 -0
  102. package/dist/visual/ProseArrayElement.svelte +98 -0
  103. package/dist/visual/ProseArrayElement.svelte.d.ts +19 -0
  104. package/dist/visual/ProseField.svelte +213 -0
  105. package/dist/visual/ProseField.svelte.d.ts +50 -0
  106. package/dist/visual/SlashMenu.svelte +126 -0
  107. package/dist/visual/SlashMenu.svelte.d.ts +14 -0
  108. package/dist/visual/TextField.svelte +63 -0
  109. package/dist/visual/TextField.svelte.d.ts +23 -0
  110. package/dist/visual/TipsCard.svelte +191 -0
  111. package/dist/visual/TipsCard.svelte.d.ts +13 -0
  112. package/dist/visual/VisualEditor.svelte +96 -0
  113. package/dist/visual/VisualEditor.svelte.d.ts +14 -0
  114. package/dist/visual/VisualEditorInner.svelte +1032 -0
  115. package/dist/visual/VisualEditorInner.svelte.d.ts +17 -0
  116. package/dist/visual/controls.css +272 -0
  117. package/dist/visual/diagnostics.d.ts +52 -0
  118. package/dist/visual/diagnostics.js +83 -0
  119. package/dist/visual/domid.d.ts +21 -0
  120. package/dist/visual/domid.js +36 -0
  121. package/dist/visual/ext.d.ts +19 -0
  122. package/dist/visual/ext.js +29 -0
  123. package/dist/visual/icons/Icon.svelte +39 -0
  124. package/dist/visual/icons/Icon.svelte.d.ts +12 -0
  125. package/dist/visual/icons/nodes.d.ts +103 -0
  126. package/dist/visual/icons/nodes.js +55 -0
  127. package/dist/visual/index.d.ts +9 -0
  128. package/dist/visual/index.js +24 -0
  129. package/dist/visual/motion.d.ts +18 -0
  130. package/dist/visual/motion.js +53 -0
  131. package/dist/visual/props.d.ts +77 -0
  132. package/dist/visual/props.js +1 -0
  133. package/dist/visual/signals.d.ts +59 -0
  134. package/dist/visual/signals.js +1 -0
  135. package/dist/visual/strings.d.ts +123 -0
  136. package/dist/visual/strings.js +80 -0
  137. package/dist/visual/structure.d.ts +224 -0
  138. package/dist/visual/structure.js +270 -0
  139. package/dist/visual/synced.svelte.d.ts +15 -0
  140. package/dist/visual/synced.svelte.js +34 -0
  141. package/dist/visual/tips.d.ts +24 -0
  142. package/dist/visual/tips.js +50 -0
  143. package/package.json +102 -0
@@ -0,0 +1,88 @@
1
+ <!--
2
+ A `boolean` field → a styled switch on bits-ui.
3
+
4
+ Styled rather than a native checkbox: the native box's face is UA-owned shadow
5
+ DOM, so no dial reaches it. The a11y comes with the primitive:
6
+ Switch.Root renders `role="switch"` with its checked state and keyboard handling.
7
+ -->
8
+ <script lang="ts">
9
+ import { Switch } from 'bits-ui';
10
+ import { syncedLocal } from './synced.svelte.js';
11
+ import './controls.css';
12
+
13
+ interface Props {
14
+ value: boolean | undefined;
15
+ fallback?: boolean;
16
+ /** Accessible name for a switch NOTHING else names: an object property, whose
17
+ * name is the field label plus the property's. A field's own switch takes `id`
18
+ * instead and is named by the `<label for>` beside it. */
19
+ label?: string;
20
+ /** `<label for>` target. `Switch.Root` renders a `<button>`, which IS labelable,
21
+ * so the click a label forwards toggles the switch: correct for this control,
22
+ * and single-fire: the label is a sibling, not a wrapper, so there is no second
23
+ * click bubbling back up to be re-dispatched. */
24
+ id?: string;
25
+ /** The parked `description` (FieldLabel): announced after the name. */
26
+ describedBy?: string;
27
+ onCommit: (v: boolean) => void;
28
+ }
29
+ let { value, fallback, label, id, describedBy, onCommit }: Props = $props();
30
+
31
+ // Local toggle state synced to `value`; own-toggles stay local, only an external
32
+ // change reconciles back in (see `syncedLocal`). The primitive is driven
33
+ // CONTROLLED (`checked` + `onCheckedChange`, never `bind:`) so reconciliation
34
+ // stays the package's: a two-way bind hands the primitive a lane around it,
35
+ // which repeats the reconciliation hazard in miniature.
36
+ const local = syncedLocal(() => value ?? fallback ?? false);
37
+ </script>
38
+
39
+ <span class="qm-switch-wrap">
40
+ <Switch.Root
41
+ class="qm-switch qm-focus-ring"
42
+ checked={local.value}
43
+ {id}
44
+ aria-label={id ? undefined : label}
45
+ aria-describedby={describedBy}
46
+ onCheckedChange={(v) => {
47
+ local.value = v;
48
+ onCommit(v);
49
+ }}
50
+ >
51
+ <Switch.Thumb class="qm-switch-thumb" />
52
+ </Switch.Root>
53
+ </span>
54
+
55
+ <style>
56
+ /* A primitive renders its OWN element, which a scoped selector cannot reach:
57
+ styled through the wrapper with `:global`. */
58
+ .qm-switch-wrap :global(.qm-switch) {
59
+ display: inline-flex;
60
+ align-items: center;
61
+ width: 1.75rem;
62
+ height: 1rem;
63
+ padding: var(--_qm-space-half);
64
+ border: var(--_qm-border-width) solid var(--_qm-border);
65
+ border-radius: var(--_qm-radius-pill);
66
+ background: var(--_qm-surface-hover);
67
+ cursor: pointer;
68
+ transition: background var(--_qm-duration-fast) var(--_qm-ease-reverse);
69
+ }
70
+ .qm-switch-wrap :global(.qm-switch[data-state='checked']) {
71
+ background: var(--_qm-accent);
72
+ border-color: var(--_qm-accent);
73
+ }
74
+ /* The focus ring rides `.qm-focus-ring` on the switch (controls.css). */
75
+ /* The thumb reads on tone alone: the base surface over the track's `hover` rung
76
+ unchecked, and over `--_qm-accent` checked. No edge of its own: a hairline around
77
+ a 12px pill is a second box inside the track's. */
78
+ .qm-switch-wrap :global(.qm-switch-thumb) {
79
+ width: 0.75rem;
80
+ height: 0.75rem;
81
+ border-radius: var(--_qm-radius-pill);
82
+ background: var(--_qm-surface);
83
+ transition: translate var(--_qm-duration-fast) var(--_qm-ease-reverse);
84
+ }
85
+ .qm-switch-wrap :global(.qm-switch-thumb[data-state='checked']) {
86
+ translate: 0.75rem;
87
+ }
88
+ </style>
@@ -0,0 +1,20 @@
1
+ import './controls.css';
2
+ interface Props {
3
+ value: boolean | undefined;
4
+ fallback?: boolean;
5
+ /** Accessible name for a switch NOTHING else names: an object property, whose
6
+ * name is the field label plus the property's. A field's own switch takes `id`
7
+ * instead and is named by the `<label for>` beside it. */
8
+ label?: string;
9
+ /** `<label for>` target. `Switch.Root` renders a `<button>`, which IS labelable,
10
+ * so the click a label forwards toggles the switch: correct for this control,
11
+ * and single-fire: the label is a sibling, not a wrapper, so there is no second
12
+ * click bubbling back up to be re-dispatched. */
13
+ id?: string;
14
+ /** The parked `description` (FieldLabel): announced after the name. */
15
+ describedBy?: string;
16
+ onCommit: (v: boolean) => void;
17
+ }
18
+ declare const BooleanField: import("svelte").Component<Props, {}, "">;
19
+ type BooleanField = ReturnType<typeof BooleanField>;
20
+ export default BooleanField;