@pie-qti/default-components 0.1.10 → 0.1.12
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/chunks/__vite-browser-external-Dz5RCjpq.js +9 -0
- package/dist/chunks/__vite-browser-external-Dz5RCjpq.js.map +1 -0
- package/dist/chunks/{mathlive.min-Bvtiaxg4.js → mathlive.min-ClqhKA_b.js} +4199 -3978
- package/dist/chunks/mathlive.min-ClqhKA_b.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/associate/index.d.ts +0 -1
- package/dist/plugins/associate/index.js +1 -0
- package/dist/plugins/associate/index.js.map +1 -0
- package/dist/plugins/choice/index.d.ts +0 -1
- package/dist/plugins/choice/index.js +1 -0
- package/dist/plugins/choice/index.js.map +1 -0
- package/dist/plugins/custom/index.d.ts +0 -1
- package/dist/plugins/custom/index.js +1 -0
- package/dist/plugins/custom/index.js.map +1 -0
- package/dist/plugins/end-attempt/index.d.ts +0 -1
- package/dist/plugins/end-attempt/index.js +1 -0
- package/dist/plugins/end-attempt/index.js.map +1 -0
- package/dist/plugins/extended-text/index.d.ts +0 -1
- package/dist/plugins/extended-text/index.js +1 -0
- package/dist/plugins/extended-text/index.js.map +1 -0
- package/dist/plugins/gap-match/index.d.ts +0 -1
- package/dist/plugins/gap-match/index.js +1 -0
- package/dist/plugins/gap-match/index.js.map +1 -0
- package/dist/plugins/graphic-associate/index.d.ts +0 -1
- package/dist/plugins/graphic-associate/index.js +1 -0
- package/dist/plugins/graphic-associate/index.js.map +1 -0
- package/dist/plugins/graphic-gap-match/index.d.ts +0 -1
- package/dist/plugins/graphic-gap-match/index.js +1 -0
- package/dist/plugins/graphic-gap-match/index.js.map +1 -0
- package/dist/plugins/graphic-order/index.d.ts +0 -1
- package/dist/plugins/graphic-order/index.js +1 -0
- package/dist/plugins/graphic-order/index.js.map +1 -0
- package/dist/plugins/hotspot/index.d.ts +0 -1
- package/dist/plugins/hotspot/index.js +1 -0
- package/dist/plugins/hotspot/index.js.map +1 -0
- package/dist/plugins/hottext/index.d.ts +0 -1
- package/dist/plugins/hottext/index.js +1 -0
- package/dist/plugins/hottext/index.js.map +1 -0
- package/dist/plugins/match/index.d.ts +0 -1
- package/dist/plugins/match/index.js +1 -0
- package/dist/plugins/match/index.js.map +1 -0
- package/dist/plugins/media/index.d.ts +0 -1
- package/dist/plugins/media/index.js +1 -0
- package/dist/plugins/media/index.js.map +1 -0
- package/dist/plugins/order/index.d.ts +0 -1
- package/dist/plugins/order/index.js +1 -0
- package/dist/plugins/order/index.js.map +1 -0
- package/dist/plugins/position-object/index.d.ts +0 -1
- package/dist/plugins/position-object/index.js +1 -0
- package/dist/plugins/position-object/index.js.map +1 -0
- package/dist/plugins/public-types.d.ts +5 -0
- package/dist/plugins/public-types.js +2 -0
- package/dist/plugins/public-types.js.map +1 -0
- package/dist/plugins/select-point/index.d.ts +0 -1
- package/dist/plugins/select-point/index.js +1 -0
- package/dist/plugins/select-point/index.js.map +1 -0
- package/dist/plugins/slider/index.d.ts +0 -1
- package/dist/plugins/slider/index.js +1 -0
- package/dist/plugins/slider/index.js.map +1 -0
- package/dist/plugins.js +27589 -9160
- package/dist/plugins.js.map +1 -1
- package/dist/shared/actions/typesetAction.d.ts +0 -1
- package/dist/shared/actions/typesetAction.js +1 -0
- package/dist/shared/actions/typesetAction.js.map +1 -0
- package/dist/shared/extensions/MathLiveEditor.d.ts +0 -1
- package/dist/shared/extensions/MathLiveEditor.js +1 -0
- package/dist/shared/extensions/MathLiveEditor.js.map +1 -0
- package/dist/shared/index.d.ts +0 -1
- package/dist/shared/index.js +1 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/utils/eventHelpers.d.ts +0 -1
- package/dist/shared/utils/eventHelpers.js +1 -0
- package/dist/shared/utils/eventHelpers.js.map +1 -0
- package/dist/shared/utils/matchGroupUtils.d.ts +0 -1
- package/dist/shared/utils/matchGroupUtils.js +1 -0
- package/dist/shared/utils/matchGroupUtils.js.map +1 -0
- package/dist/shared/utils/pairHelpers.d.ts +0 -1
- package/dist/shared/utils/pairHelpers.js +1 -0
- package/dist/shared/utils/pairHelpers.js.map +1 -0
- package/dist/shared/utils/webComponentHelpers.d.ts +0 -1
- package/dist/shared/utils/webComponentHelpers.js +1 -0
- package/dist/shared/utils/webComponentHelpers.js.map +1 -0
- package/package.json +15 -33
- package/dist/chunks/mathlive.min-Bvtiaxg4.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/plugins/associate/index.d.ts.map +0 -1
- package/dist/plugins/choice/index.d.ts.map +0 -1
- package/dist/plugins/custom/index.d.ts.map +0 -1
- package/dist/plugins/end-attempt/index.d.ts.map +0 -1
- package/dist/plugins/extended-text/index.d.ts.map +0 -1
- package/dist/plugins/gap-match/index.d.ts.map +0 -1
- package/dist/plugins/graphic-associate/index.d.ts.map +0 -1
- package/dist/plugins/graphic-gap-match/index.d.ts.map +0 -1
- package/dist/plugins/graphic-order/index.d.ts.map +0 -1
- package/dist/plugins/hotspot/index.d.ts.map +0 -1
- package/dist/plugins/hottext/index.d.ts.map +0 -1
- package/dist/plugins/index.d.ts +0 -31
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/index.js +0 -31
- package/dist/plugins/match/index.d.ts.map +0 -1
- package/dist/plugins/media/index.d.ts.map +0 -1
- package/dist/plugins/order/index.d.ts.map +0 -1
- package/dist/plugins/position-object/index.d.ts.map +0 -1
- package/dist/plugins/select-point/index.d.ts.map +0 -1
- package/dist/plugins/slider/index.d.ts.map +0 -1
- package/dist/shared/actions/typesetAction.d.ts.map +0 -1
- package/dist/shared/extensions/MathLiveEditor.d.ts.map +0 -1
- package/dist/shared/index.d.ts.map +0 -1
- package/dist/shared/utils/eventHelpers.d.ts.map +0 -1
- package/dist/shared/utils/matchGroupUtils.d.ts.map +0 -1
- package/dist/shared/utils/pairHelpers.d.ts.map +0 -1
- package/dist/shared/utils/touchDragHelper.d.ts +0 -2
- package/dist/shared/utils/touchDragHelper.d.ts.map +0 -1
- package/dist/shared/utils/touchDragHelper.js +0 -1
- package/dist/shared/utils/webComponentHelpers.d.ts.map +0 -1
- package/src/catalog/CatalogPopup.svelte +0 -163
- package/src/index.ts +0 -141
- package/src/plugins/associate/AssociateInteraction.svelte +0 -304
- package/src/plugins/associate/index.ts +0 -9
- package/src/plugins/choice/ChoiceInteraction.svelte +0 -355
- package/src/plugins/choice/index.ts +0 -9
- package/src/plugins/custom/CustomInteraction.svelte +0 -61
- package/src/plugins/custom/index.ts +0 -9
- package/src/plugins/drawing/DrawingInteraction.svelte +0 -99
- package/src/plugins/end-attempt/EndAttemptInteraction.svelte +0 -142
- package/src/plugins/end-attempt/index.ts +0 -9
- package/src/plugins/extended-text/ExtendedTextInteraction.svelte +0 -152
- package/src/plugins/extended-text/index.ts +0 -9
- package/src/plugins/gap-match/GapMatchInteraction.svelte +0 -556
- package/src/plugins/gap-match/index.ts +0 -9
- package/src/plugins/graphic-associate/GraphicAssociateInteraction.svelte +0 -503
- package/src/plugins/graphic-associate/index.ts +0 -9
- package/src/plugins/graphic-gap-match/GraphicGapMatchInteraction.svelte +0 -593
- package/src/plugins/graphic-gap-match/index.ts +0 -9
- package/src/plugins/graphic-order/GraphicOrderInteraction.svelte +0 -241
- package/src/plugins/graphic-order/index.ts +0 -9
- package/src/plugins/hotspot/HotspotInteraction.svelte +0 -287
- package/src/plugins/hotspot/index.ts +0 -9
- package/src/plugins/hottext/HottextInteraction.svelte +0 -325
- package/src/plugins/hottext/index.ts +0 -9
- package/src/plugins/index.ts +0 -32
- package/src/plugins/match/MatchInteraction.svelte +0 -82
- package/src/plugins/match/index.ts +0 -9
- package/src/plugins/media/MediaInteraction.svelte +0 -216
- package/src/plugins/media/index.ts +0 -9
- package/src/plugins/order/OrderInteraction.svelte +0 -280
- package/src/plugins/order/index.ts +0 -9
- package/src/plugins/position-object/PositionObjectInteraction.svelte +0 -903
- package/src/plugins/position-object/README.md +0 -130
- package/src/plugins/position-object/index.ts +0 -9
- package/src/plugins/select-point/SelectPointInteraction.svelte +0 -571
- package/src/plugins/select-point/index.ts +0 -9
- package/src/plugins/slider/SliderInteraction.svelte +0 -141
- package/src/plugins/slider/index.ts +0 -9
- package/src/plugins/upload/UploadInteraction.svelte +0 -59
- package/src/shared/actions/typesetAction.ts +0 -87
- package/src/shared/components/CustomInteractionFallback.svelte +0 -153
- package/src/shared/components/DragHandle.svelte +0 -44
- package/src/shared/components/DrawingCanvas.svelte +0 -259
- package/src/shared/components/FileUpload.svelte +0 -158
- package/src/shared/components/GraphicGapMatch.svelte +0 -318
- package/src/shared/components/GraphicGapMatchAdapter.svelte +0 -45
- package/src/shared/components/InlineInteractionRenderer.svelte +0 -141
- package/src/shared/components/MatchDragDrop.svelte +0 -481
- package/src/shared/components/MathContent.svelte +0 -18
- package/src/shared/components/ModalFeedbackDisplay.svelte +0 -91
- package/src/shared/components/RichTextEditor.svelte +0 -316
- package/src/shared/components/ShadowBaseStyles.svelte +0 -390
- package/src/shared/components/SortableList.svelte +0 -297
- package/src/shared/extensions/MathLiveEditor.ts +0 -299
- package/src/shared/index.ts +0 -15
- package/src/shared/styles/shared.css +0 -16
- package/src/shared/utils/eventHelpers.ts +0 -69
- package/src/shared/utils/matchGroupUtils.ts +0 -14
- package/src/shared/utils/pairHelpers.ts +0 -109
- package/src/shared/utils/webComponentHelpers.ts +0 -69
- package/src/svelte-shims.d.ts +0 -9
- /package/{src → dist}/shared/styles/qti-shared-vocabulary.css +0 -0
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
import { Editor } from '@tiptap/core';
|
|
4
|
-
import { Mathematics } from '@tiptap/extension-mathematics';
|
|
5
|
-
import Placeholder from '@tiptap/extension-placeholder';
|
|
6
|
-
import StarterKit from '@tiptap/starter-kit';
|
|
7
|
-
import { untrack } from 'svelte';
|
|
8
|
-
import type { I18nProvider } from '@pie-qti/i18n';
|
|
9
|
-
import { openMathLiveEditor } from '../extensions/MathLiveEditor.js';
|
|
10
|
-
|
|
11
|
-
interface Props {
|
|
12
|
-
value?: string;
|
|
13
|
-
editable?: boolean;
|
|
14
|
-
placeholder?: string;
|
|
15
|
-
minHeight?: number;
|
|
16
|
-
i18n?: I18nProvider;
|
|
17
|
-
onChange?: (html: string) => void;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const {
|
|
21
|
-
value = '',
|
|
22
|
-
editable = true,
|
|
23
|
-
placeholder = '',
|
|
24
|
-
minHeight = 200,
|
|
25
|
-
i18n,
|
|
26
|
-
onChange,
|
|
27
|
-
}: Props = $props();
|
|
28
|
-
|
|
29
|
-
// Translations
|
|
30
|
-
const translations = $derived({
|
|
31
|
-
bold: i18n?.t('interactions.extendedText.bold') ?? 'interactions.extendedText.bold',
|
|
32
|
-
italic: i18n?.t('interactions.extendedText.italic') ?? 'interactions.extendedText.italic',
|
|
33
|
-
insertInlineMath: i18n?.t('interactions.extendedText.insertInlineMath') ?? 'interactions.extendedText.insertInlineMath',
|
|
34
|
-
insertBlockMath: i18n?.t('interactions.extendedText.insertBlockMath') ?? 'interactions.extendedText.insertBlockMath',
|
|
35
|
-
editorLabel: placeholder || (i18n?.t('interactions.extendedText.placeholder') ?? 'interactions.extendedText.placeholder'),
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
let el: HTMLDivElement | null = $state(null);
|
|
39
|
-
let editor: Editor | null = $state(null);
|
|
40
|
-
// Use a regular variable (not $state) to track last emitted value
|
|
41
|
-
// This prevents circular dependencies in $effect
|
|
42
|
-
let lastEmitted = '';
|
|
43
|
-
// Track if we're currently programmatically updating to avoid loops
|
|
44
|
-
let isProgrammaticUpdate = false;
|
|
45
|
-
|
|
46
|
-
function emit(html: string) {
|
|
47
|
-
// Don't emit changes that we're causing programmatically
|
|
48
|
-
if (isProgrammaticUpdate) return;
|
|
49
|
-
lastEmitted = html;
|
|
50
|
-
onChange?.(html);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function insertInlineMath() {
|
|
54
|
-
if (!editor) return;
|
|
55
|
-
openMathLiveEditor({
|
|
56
|
-
initialLatex: '\\frac{a}{b}',
|
|
57
|
-
isBlock: false,
|
|
58
|
-
i18n,
|
|
59
|
-
onConfirm: (latex) => {
|
|
60
|
-
editor?.commands.insertInlineMath({ latex });
|
|
61
|
-
editor?.commands.focus();
|
|
62
|
-
},
|
|
63
|
-
onCancel: () => {
|
|
64
|
-
editor?.commands.focus();
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function insertBlockMath() {
|
|
70
|
-
if (!editor) return;
|
|
71
|
-
openMathLiveEditor({
|
|
72
|
-
initialLatex: '\\frac{a}{b}',
|
|
73
|
-
isBlock: true,
|
|
74
|
-
i18n,
|
|
75
|
-
onConfirm: (latex) => {
|
|
76
|
-
editor?.commands.insertBlockMath({ latex });
|
|
77
|
-
editor?.commands.focus();
|
|
78
|
-
},
|
|
79
|
-
onCancel: () => {
|
|
80
|
-
editor?.commands.focus();
|
|
81
|
-
},
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// Initialize editor once when element is available
|
|
86
|
-
// Only tracks 'el' as a dependency, use untrack for other props to prevent recreation
|
|
87
|
-
$effect(() => {
|
|
88
|
-
if (!el) return;
|
|
89
|
-
|
|
90
|
-
// Capture initial values without tracking them as dependencies
|
|
91
|
-
const initialValue = untrack(() => value?.trim() ? value : '<p></p>');
|
|
92
|
-
const initialPlaceholder = untrack(() => placeholder);
|
|
93
|
-
const initialMinHeight = untrack(() => minHeight);
|
|
94
|
-
const initialEditable = untrack(() => editable);
|
|
95
|
-
const initialEditorLabel = untrack(() => translations.editorLabel);
|
|
96
|
-
const initialI18n = untrack(() => i18n);
|
|
97
|
-
|
|
98
|
-
const ed = new Editor({
|
|
99
|
-
element: el,
|
|
100
|
-
extensions: [
|
|
101
|
-
StarterKit.configure({
|
|
102
|
-
// keep these minimal, but sensible for extended response editing
|
|
103
|
-
codeBlock: false,
|
|
104
|
-
}),
|
|
105
|
-
Placeholder.configure({
|
|
106
|
-
placeholder: initialPlaceholder,
|
|
107
|
-
}),
|
|
108
|
-
Mathematics.configure({
|
|
109
|
-
inlineOptions: {
|
|
110
|
-
onClick: (node, pos) => {
|
|
111
|
-
openMathLiveEditor({
|
|
112
|
-
initialLatex: node.attrs?.latex || '',
|
|
113
|
-
isBlock: false,
|
|
114
|
-
i18n: initialI18n,
|
|
115
|
-
onConfirm: (latex) => {
|
|
116
|
-
ed.chain().setNodeSelection(pos).updateInlineMath({ latex }).focus().run();
|
|
117
|
-
},
|
|
118
|
-
onCancel: () => {
|
|
119
|
-
ed.commands.focus();
|
|
120
|
-
},
|
|
121
|
-
});
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
blockOptions: {
|
|
125
|
-
onClick: (node, pos) => {
|
|
126
|
-
openMathLiveEditor({
|
|
127
|
-
initialLatex: node.attrs?.latex || '',
|
|
128
|
-
isBlock: true,
|
|
129
|
-
i18n: initialI18n,
|
|
130
|
-
onConfirm: (latex) => {
|
|
131
|
-
ed.chain().setNodeSelection(pos).updateBlockMath({ latex }).focus().run();
|
|
132
|
-
},
|
|
133
|
-
onCancel: () => {
|
|
134
|
-
ed.commands.focus();
|
|
135
|
-
},
|
|
136
|
-
});
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
katexOptions: {
|
|
140
|
-
throwOnError: false,
|
|
141
|
-
},
|
|
142
|
-
}),
|
|
143
|
-
],
|
|
144
|
-
content: initialValue,
|
|
145
|
-
editable: initialEditable,
|
|
146
|
-
editorProps: {
|
|
147
|
-
attributes: {
|
|
148
|
-
// Stable hook for theming. The host app's DaisyUI theme vars cascade here.
|
|
149
|
-
class: 'pie-tiptap tiptap-prose',
|
|
150
|
-
style: `min-height: ${initialMinHeight}px`,
|
|
151
|
-
role: 'textbox',
|
|
152
|
-
'aria-multiline': 'true',
|
|
153
|
-
'aria-label': initialEditorLabel,
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
onUpdate: ({ editor: ed }) => {
|
|
157
|
-
const html = ed.getHTML();
|
|
158
|
-
// Only emit if content actually changed
|
|
159
|
-
if (html !== lastEmitted) {
|
|
160
|
-
emit(html);
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
editor = ed;
|
|
166
|
-
lastEmitted = ed.getHTML();
|
|
167
|
-
|
|
168
|
-
return () => {
|
|
169
|
-
editor?.destroy();
|
|
170
|
-
editor = null;
|
|
171
|
-
};
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
// Keep editable in sync (without re-creating the editor)
|
|
175
|
-
$effect(() => {
|
|
176
|
-
if (editor) {
|
|
177
|
-
editor.setEditable(editable);
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
// External value updates (avoid stomping over active edits)
|
|
182
|
-
$effect(() => {
|
|
183
|
-
if (!editor) return;
|
|
184
|
-
// Only react to value prop changes
|
|
185
|
-
const next = value || '';
|
|
186
|
-
// Skip if this value was just emitted by us
|
|
187
|
-
if (next === lastEmitted) return;
|
|
188
|
-
// Don't interrupt active editing
|
|
189
|
-
if (editor.isFocused) return;
|
|
190
|
-
// Set flag to prevent emit from firing during programmatic update
|
|
191
|
-
isProgrammaticUpdate = true;
|
|
192
|
-
try {
|
|
193
|
-
// Update editor content without triggering onUpdate callback
|
|
194
|
-
editor.commands.setContent(next || '<p></p>', { emitUpdate: false });
|
|
195
|
-
// Track what we set so we don't react to our own updates
|
|
196
|
-
lastEmitted = editor.getHTML();
|
|
197
|
-
} finally {
|
|
198
|
-
isProgrammaticUpdate = false;
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
</script>
|
|
202
|
-
|
|
203
|
-
<div part="root" class="richtext-editor" data-readonly={editable ? 'false' : 'true'}>
|
|
204
|
-
<div part="toolbar" class="rte-toolbar">
|
|
205
|
-
<button
|
|
206
|
-
part="toolbar-button"
|
|
207
|
-
class="btn btn-sm"
|
|
208
|
-
type="button"
|
|
209
|
-
disabled={!editor || !editable}
|
|
210
|
-
onclick={() => editor?.chain().focus().toggleBold().run()}
|
|
211
|
-
aria-label={translations.bold}
|
|
212
|
-
>
|
|
213
|
-
<strong>B</strong>
|
|
214
|
-
</button>
|
|
215
|
-
<button
|
|
216
|
-
part="toolbar-button"
|
|
217
|
-
class="btn btn-sm"
|
|
218
|
-
type="button"
|
|
219
|
-
disabled={!editor || !editable}
|
|
220
|
-
onclick={() => editor?.chain().focus().toggleItalic().run()}
|
|
221
|
-
aria-label={translations.italic}
|
|
222
|
-
>
|
|
223
|
-
<em>I</em>
|
|
224
|
-
</button>
|
|
225
|
-
<div part="toolbar-divider" class="divider divider-horizontal mx-0"></div>
|
|
226
|
-
<button
|
|
227
|
-
part="toolbar-button"
|
|
228
|
-
class="btn btn-sm"
|
|
229
|
-
type="button"
|
|
230
|
-
disabled={!editor || !editable}
|
|
231
|
-
onclick={() => insertInlineMath()}
|
|
232
|
-
aria-label={translations.insertInlineMath}
|
|
233
|
-
>
|
|
234
|
-
{translations.insertInlineMath}
|
|
235
|
-
</button>
|
|
236
|
-
<button
|
|
237
|
-
part="toolbar-button"
|
|
238
|
-
class="btn btn-sm"
|
|
239
|
-
type="button"
|
|
240
|
-
disabled={!editor || !editable}
|
|
241
|
-
onclick={() => insertBlockMath()}
|
|
242
|
-
aria-label={translations.insertBlockMath}
|
|
243
|
-
>
|
|
244
|
-
{translations.insertBlockMath}
|
|
245
|
-
</button>
|
|
246
|
-
</div>
|
|
247
|
-
|
|
248
|
-
<div part="editor" class="tiptap-editor-container" bind:this={el}></div>
|
|
249
|
-
</div>
|
|
250
|
-
|
|
251
|
-
<style>
|
|
252
|
-
.richtext-editor {
|
|
253
|
-
display: flex;
|
|
254
|
-
flex-direction: column;
|
|
255
|
-
gap: 0.5rem;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
.rte-toolbar {
|
|
259
|
-
display: flex;
|
|
260
|
-
align-items: center;
|
|
261
|
-
gap: 0.25rem;
|
|
262
|
-
flex-wrap: wrap;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.tiptap-editor-container {
|
|
266
|
-
background: var(--color-base-100, oklch(100% 0 0));
|
|
267
|
-
border: 1px solid var(--color-base-300, oklch(95% 0 0));
|
|
268
|
-
border-radius: 0.5rem;
|
|
269
|
-
padding: 0.75rem;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
.tiptap-editor-container:focus-within {
|
|
273
|
-
border-color: var(--color-primary, oklch(45% 0.24 277));
|
|
274
|
-
box-shadow: 0 0 0 2px color-mix(in oklch, var(--color-primary, oklch(45% 0.24 277)) 20%, transparent);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.richtext-editor[data-readonly='true'] .tiptap-editor-container {
|
|
278
|
-
background: var(--color-base-200, oklch(98% 0 0));
|
|
279
|
-
cursor: not-allowed;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
/* Prose content styling (scoped to our stable hook) */
|
|
283
|
-
:global(.pie-tiptap) {
|
|
284
|
-
outline: none;
|
|
285
|
-
color: var(--color-base-content, oklch(21% 0 0));
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
:global(.pie-tiptap p) {
|
|
289
|
-
margin: 0 0 0.5rem 0;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
:global(.pie-tiptap p:last-child) {
|
|
293
|
-
margin-bottom: 0;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
/* Placeholder */
|
|
297
|
-
:global(.pie-tiptap p.is-editor-empty:first-child::before) {
|
|
298
|
-
content: attr(data-placeholder);
|
|
299
|
-
float: left;
|
|
300
|
-
color: color-mix(in oklch, var(--color-base-content, oklch(21% 0 0)) 45%, transparent);
|
|
301
|
-
pointer-events: none;
|
|
302
|
-
height: 0;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
/* Mathematics extension (KaTeX) */
|
|
306
|
-
:global(.pie-tiptap .katex) {
|
|
307
|
-
font-size: 1em;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
:global(.pie-tiptap .katex-display) {
|
|
311
|
-
margin: 1rem 0;
|
|
312
|
-
text-align: center;
|
|
313
|
-
}
|
|
314
|
-
</style>
|
|
315
|
-
|
|
316
|
-
|
|
@@ -1,390 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Shared baseline styles for Shadow DOM web components.
|
|
3
|
-
|
|
4
|
-
Purpose:
|
|
5
|
-
- Provide minimal, readable styling when the host does NOT load DaisyUI/Tailwind CSS.
|
|
6
|
-
- Still allow host theming via DaisyUI-like CSS variables (e.g. --p, --b1, --bc).
|
|
7
|
-
|
|
8
|
-
Notes:
|
|
9
|
-
- Uses :global(...) so these styles apply within the component's shadow root.
|
|
10
|
-
- Intentionally minimal: interaction components may still add their own layout CSS.
|
|
11
|
-
-->
|
|
12
|
-
|
|
13
|
-
<style>
|
|
14
|
-
/* KaTeX CSS is provided by host app bundles (avoid runtime @import 404s in nested routes). */
|
|
15
|
-
/* Buttons */
|
|
16
|
-
:global(.btn) {
|
|
17
|
-
display: inline-flex;
|
|
18
|
-
align-items: center;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
gap: 0.5rem;
|
|
21
|
-
padding: 0.5rem 0.75rem;
|
|
22
|
-
border-radius: 0.75rem;
|
|
23
|
-
border: 1px solid var(--color-base-300, oklch(95% 0 0));
|
|
24
|
-
background: var(--color-base-200, oklch(98% 0 0));
|
|
25
|
-
color: var(--color-base-content, oklch(21% 0 0));
|
|
26
|
-
font: inherit;
|
|
27
|
-
line-height: 1.1;
|
|
28
|
-
cursor: pointer;
|
|
29
|
-
user-select: none;
|
|
30
|
-
transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
|
|
31
|
-
}
|
|
32
|
-
:global(.btn:hover:not(:disabled)) {
|
|
33
|
-
background: var(--color-base-300, oklch(95% 0 0));
|
|
34
|
-
border-color: var(--color-base-content, oklch(21% 0 0));
|
|
35
|
-
}
|
|
36
|
-
:global(.btn:active:not(:disabled)) {
|
|
37
|
-
transform: scale(0.97);
|
|
38
|
-
}
|
|
39
|
-
:global(.btn:focus-visible) {
|
|
40
|
-
outline: 2px solid var(--color-primary, oklch(45% 0.24 277));
|
|
41
|
-
outline-offset: 2px;
|
|
42
|
-
}
|
|
43
|
-
:global(.btn:disabled),
|
|
44
|
-
:global(.btn.btn-disabled) {
|
|
45
|
-
opacity: 0.55;
|
|
46
|
-
cursor: not-allowed;
|
|
47
|
-
}
|
|
48
|
-
:global(.btn-primary) {
|
|
49
|
-
border-color: var(--color-primary, oklch(45% 0.24 277));
|
|
50
|
-
background: color-mix(in oklch, var(--color-primary, oklch(45% 0.24 277)) 12%, transparent);
|
|
51
|
-
}
|
|
52
|
-
:global(.btn-secondary) {
|
|
53
|
-
border-color: var(--color-secondary, oklch(65% 0.241 354.308));
|
|
54
|
-
background: color-mix(in oklch, var(--color-secondary, oklch(65% 0.241 354.308)) 12%, transparent);
|
|
55
|
-
}
|
|
56
|
-
:global(.btn-accent) {
|
|
57
|
-
border-color: var(--color-accent, oklch(77% 0.152 181.912));
|
|
58
|
-
background: color-mix(in oklch, var(--color-accent, oklch(77% 0.152 181.912)) 12%, transparent);
|
|
59
|
-
}
|
|
60
|
-
:global(.btn-success) {
|
|
61
|
-
border-color: var(--color-success, oklch(76% 0.177 163.223));
|
|
62
|
-
background: color-mix(in oklch, var(--color-success, oklch(76% 0.177 163.223)) 12%, transparent);
|
|
63
|
-
}
|
|
64
|
-
:global(.btn-warning) {
|
|
65
|
-
border-color: var(--color-warning, oklch(82% 0.189 84.429));
|
|
66
|
-
background: color-mix(in oklch, var(--color-warning, oklch(82% 0.189 84.429)) 12%, transparent);
|
|
67
|
-
}
|
|
68
|
-
:global(.btn-error) {
|
|
69
|
-
border-color: var(--color-error, oklch(71% 0.194 13.428));
|
|
70
|
-
background: color-mix(in oklch, var(--color-error, oklch(71% 0.194 13.428)) 12%, transparent);
|
|
71
|
-
}
|
|
72
|
-
:global(.btn-ghost) {
|
|
73
|
-
background: transparent;
|
|
74
|
-
border-color: transparent;
|
|
75
|
-
}
|
|
76
|
-
:global(.btn-ghost:hover:not(:disabled)) {
|
|
77
|
-
background: var(--color-base-200, oklch(98% 0 0));
|
|
78
|
-
border-color: var(--color-base-300, oklch(95% 0 0));
|
|
79
|
-
}
|
|
80
|
-
:global(.btn-outline) {
|
|
81
|
-
background: transparent;
|
|
82
|
-
}
|
|
83
|
-
:global(.btn-sm) {
|
|
84
|
-
padding: 0.35rem 0.6rem;
|
|
85
|
-
border-radius: 0.6rem;
|
|
86
|
-
font-size: 0.875rem;
|
|
87
|
-
}
|
|
88
|
-
:global(.btn-xs) {
|
|
89
|
-
padding: 0.25rem 0.45rem;
|
|
90
|
-
border-radius: 0.5rem;
|
|
91
|
-
font-size: 0.75rem;
|
|
92
|
-
}
|
|
93
|
-
:global(.btn-circle) {
|
|
94
|
-
border-radius: 9999px;
|
|
95
|
-
padding: 0;
|
|
96
|
-
width: 2rem;
|
|
97
|
-
height: 2rem;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/* Badges */
|
|
101
|
-
:global(.badge) {
|
|
102
|
-
display: inline-flex;
|
|
103
|
-
align-items: center;
|
|
104
|
-
justify-content: center;
|
|
105
|
-
padding: 0 0.5rem;
|
|
106
|
-
height: 1.25rem;
|
|
107
|
-
border-radius: 9999px;
|
|
108
|
-
border: 1px solid var(--color-base-300, oklch(95% 0 0));
|
|
109
|
-
background: var(--color-base-100, oklch(100% 0 0));
|
|
110
|
-
color: var(--color-base-content, oklch(21% 0 0));
|
|
111
|
-
font-size: 0.75rem;
|
|
112
|
-
font-weight: 600;
|
|
113
|
-
}
|
|
114
|
-
:global(.badge-sm) {
|
|
115
|
-
height: 1.1rem;
|
|
116
|
-
font-size: 0.7rem;
|
|
117
|
-
}
|
|
118
|
-
:global(.badge-lg) {
|
|
119
|
-
height: 1.5rem;
|
|
120
|
-
font-size: 0.85rem;
|
|
121
|
-
}
|
|
122
|
-
:global(.badge-primary) {
|
|
123
|
-
border-color: var(--color-primary, oklch(45% 0.24 277));
|
|
124
|
-
background: color-mix(in oklch, var(--color-primary, oklch(45% 0.24 277)) 12%, transparent);
|
|
125
|
-
}
|
|
126
|
-
:global(.badge-success) {
|
|
127
|
-
border-color: var(--color-success, oklch(76% 0.177 163.223));
|
|
128
|
-
background: color-mix(in oklch, var(--color-success, oklch(76% 0.177 163.223)) 12%, transparent);
|
|
129
|
-
}
|
|
130
|
-
:global(.badge-warning) {
|
|
131
|
-
border-color: var(--color-warning, oklch(82% 0.189 84.429));
|
|
132
|
-
background: color-mix(in oklch, var(--color-warning, oklch(82% 0.189 84.429)) 12%, transparent);
|
|
133
|
-
}
|
|
134
|
-
:global(.badge-error) {
|
|
135
|
-
border-color: var(--color-error, oklch(71% 0.194 13.428));
|
|
136
|
-
background: color-mix(in oklch, var(--color-error, oklch(71% 0.194 13.428)) 12%, transparent);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/* Alerts */
|
|
140
|
-
:global(.alert) {
|
|
141
|
-
display: flex;
|
|
142
|
-
align-items: center;
|
|
143
|
-
gap: 0.5rem;
|
|
144
|
-
padding: 0.75rem 1rem;
|
|
145
|
-
border-radius: 0.75rem;
|
|
146
|
-
border: 1px solid var(--color-base-300, oklch(95% 0 0));
|
|
147
|
-
background: var(--color-base-200, oklch(98% 0 0));
|
|
148
|
-
color: var(--color-base-content, oklch(21% 0 0));
|
|
149
|
-
}
|
|
150
|
-
:global(.alert-info) {
|
|
151
|
-
border-color: var(--color-info, oklch(74% 0.16 232.661));
|
|
152
|
-
background: color-mix(in oklch, var(--color-info, oklch(74% 0.16 232.661)) 8%, transparent);
|
|
153
|
-
}
|
|
154
|
-
:global(.alert-success) {
|
|
155
|
-
border-color: var(--color-success, oklch(76% 0.177 163.223));
|
|
156
|
-
background: color-mix(in oklch, var(--color-success, oklch(76% 0.177 163.223)) 8%, transparent);
|
|
157
|
-
}
|
|
158
|
-
:global(.alert-warning) {
|
|
159
|
-
border-color: var(--color-warning, oklch(82% 0.189 84.429));
|
|
160
|
-
background: color-mix(in oklch, var(--color-warning, oklch(82% 0.189 84.429)) 8%, transparent);
|
|
161
|
-
}
|
|
162
|
-
:global(.alert-error) {
|
|
163
|
-
border-color: var(--color-error, oklch(71% 0.194 13.428));
|
|
164
|
-
background: color-mix(in oklch, var(--color-error, oklch(71% 0.194 13.428)) 8%, transparent);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/* Correct answer indicators */
|
|
168
|
-
:global(.qti-correct-indicator) {
|
|
169
|
-
display: inline-flex;
|
|
170
|
-
align-items: center;
|
|
171
|
-
gap: 0.25rem;
|
|
172
|
-
padding: 0.25rem 0.5rem;
|
|
173
|
-
background: color-mix(in oklch, var(--color-success, oklch(76% 0.177 163.223)) 8%, transparent);
|
|
174
|
-
border: 1px solid var(--color-success, oklch(76% 0.177 163.223));
|
|
175
|
-
border-radius: 0.5rem;
|
|
176
|
-
color: var(--color-base-content, oklch(21% 0 0));
|
|
177
|
-
font-size: 0.875rem;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
:global(.qti-correct-highlight) {
|
|
181
|
-
background-color: color-mix(in oklch, var(--color-success, oklch(76% 0.177 163.223)) 8%, transparent);
|
|
182
|
-
border: 2px solid var(--color-success, oklch(76% 0.177 163.223));
|
|
183
|
-
border-radius: 0.5rem;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
:global(.border-success) {
|
|
187
|
-
border-color: var(--color-success, oklch(76% 0.177 163.223));
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
:global(.text-success) {
|
|
191
|
-
color: var(--color-success, oklch(76% 0.177 163.223));
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/* Cards */
|
|
195
|
-
:global(.card) {
|
|
196
|
-
border-radius: 0.75rem;
|
|
197
|
-
border: 1px solid var(--color-base-300, oklch(95% 0 0));
|
|
198
|
-
background: var(--color-base-100, oklch(100% 0 0));
|
|
199
|
-
}
|
|
200
|
-
:global(.card-body) {
|
|
201
|
-
padding: 1rem;
|
|
202
|
-
}
|
|
203
|
-
:global(.card-title) {
|
|
204
|
-
font-weight: 700;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/* Divider */
|
|
208
|
-
:global(.divider) {
|
|
209
|
-
display: flex;
|
|
210
|
-
align-items: center;
|
|
211
|
-
gap: 0.75rem;
|
|
212
|
-
margin: 0.75rem 0;
|
|
213
|
-
color: color-mix(in oklch, var(--color-base-content, oklch(21% 0 0)) 65%, transparent);
|
|
214
|
-
font-size: 0.875rem;
|
|
215
|
-
}
|
|
216
|
-
:global(.divider::before),
|
|
217
|
-
:global(.divider::after) {
|
|
218
|
-
content: '';
|
|
219
|
-
flex: 1 1 auto;
|
|
220
|
-
height: 1px;
|
|
221
|
-
background: var(--color-base-300, oklch(95% 0 0));
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/* Form controls */
|
|
225
|
-
:global(.select),
|
|
226
|
-
:global(.textarea) {
|
|
227
|
-
border-radius: 0.6rem;
|
|
228
|
-
border: 1px solid var(--color-base-300, oklch(95% 0 0));
|
|
229
|
-
background: var(--color-base-100, oklch(100% 0 0));
|
|
230
|
-
color: var(--color-base-content, oklch(21% 0 0));
|
|
231
|
-
padding: 0.35rem 0.6rem;
|
|
232
|
-
font: inherit;
|
|
233
|
-
}
|
|
234
|
-
:global(.select-sm) {
|
|
235
|
-
font-size: 0.85rem;
|
|
236
|
-
padding: 0.25rem 0.5rem;
|
|
237
|
-
}
|
|
238
|
-
:global(.textarea) {
|
|
239
|
-
padding: 0.5rem 0.75rem;
|
|
240
|
-
}
|
|
241
|
-
:global(.radio),
|
|
242
|
-
:global(.checkbox) {
|
|
243
|
-
accent-color: var(--color-primary, oklch(45% 0.24 277));
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
/* Tailwind utilities for canvas drawing */
|
|
247
|
-
:global(.touch-none) {
|
|
248
|
-
touch-action: none;
|
|
249
|
-
}
|
|
250
|
-
:global(.absolute) {
|
|
251
|
-
position: absolute;
|
|
252
|
-
}
|
|
253
|
-
:global(.relative) {
|
|
254
|
-
position: relative;
|
|
255
|
-
}
|
|
256
|
-
:global(.inset-0) {
|
|
257
|
-
top: 0;
|
|
258
|
-
right: 0;
|
|
259
|
-
bottom: 0;
|
|
260
|
-
left: 0;
|
|
261
|
-
}
|
|
262
|
-
:global(.inline-block) {
|
|
263
|
-
display: inline-block;
|
|
264
|
-
}
|
|
265
|
-
:global(.inline-flex) {
|
|
266
|
-
display: inline-flex;
|
|
267
|
-
}
|
|
268
|
-
:global(.flex) {
|
|
269
|
-
display: flex;
|
|
270
|
-
}
|
|
271
|
-
:global(.items-center) {
|
|
272
|
-
align-items: center;
|
|
273
|
-
}
|
|
274
|
-
:global(.items-start) {
|
|
275
|
-
align-items: flex-start;
|
|
276
|
-
}
|
|
277
|
-
:global(.justify-between) {
|
|
278
|
-
justify-content: space-between;
|
|
279
|
-
}
|
|
280
|
-
:global(.gap-2) {
|
|
281
|
-
gap: 0.5rem;
|
|
282
|
-
}
|
|
283
|
-
:global(.gap-4) {
|
|
284
|
-
gap: 1rem;
|
|
285
|
-
}
|
|
286
|
-
:global(.space-y-2 > * + *) {
|
|
287
|
-
margin-top: 0.5rem;
|
|
288
|
-
}
|
|
289
|
-
:global(.space-y-3 > * + *) {
|
|
290
|
-
margin-top: 0.75rem;
|
|
291
|
-
}
|
|
292
|
-
:global(.overflow-hidden) {
|
|
293
|
-
overflow: hidden;
|
|
294
|
-
}
|
|
295
|
-
:global(.rounded) {
|
|
296
|
-
border-radius: 0.25rem;
|
|
297
|
-
}
|
|
298
|
-
:global(.border) {
|
|
299
|
-
border-width: 1px;
|
|
300
|
-
}
|
|
301
|
-
:global(.border-base-300) {
|
|
302
|
-
border-color: var(--color-base-300, oklch(95% 0 0));
|
|
303
|
-
}
|
|
304
|
-
:global(.bg-base-100) {
|
|
305
|
-
background-color: var(--color-base-100, oklch(100% 0 0));
|
|
306
|
-
}
|
|
307
|
-
:global(.bg-base-content\/70) {
|
|
308
|
-
background-color: color-mix(in oklch, var(--color-base-content, oklch(21% 0 0)) 70%, transparent);
|
|
309
|
-
}
|
|
310
|
-
:global(.text-xs) {
|
|
311
|
-
font-size: 0.75rem;
|
|
312
|
-
line-height: 1rem;
|
|
313
|
-
}
|
|
314
|
-
:global(.text-sm) {
|
|
315
|
-
font-size: 0.875rem;
|
|
316
|
-
line-height: 1.25rem;
|
|
317
|
-
}
|
|
318
|
-
:global(.font-semibold) {
|
|
319
|
-
font-weight: 600;
|
|
320
|
-
}
|
|
321
|
-
:global(.text-base-content\/70) {
|
|
322
|
-
color: color-mix(in oklch, var(--color-base-content, oklch(21% 0 0)) 70%, transparent);
|
|
323
|
-
}
|
|
324
|
-
:global(.mb-2) {
|
|
325
|
-
margin-bottom: 0.5rem;
|
|
326
|
-
}
|
|
327
|
-
:global(.mb-3) {
|
|
328
|
-
margin-bottom: 0.75rem;
|
|
329
|
-
}
|
|
330
|
-
:global(.mr-2) {
|
|
331
|
-
margin-right: 0.5rem;
|
|
332
|
-
}
|
|
333
|
-
:global(.w-full) {
|
|
334
|
-
width: 100%;
|
|
335
|
-
}
|
|
336
|
-
:global(.w-auto) {
|
|
337
|
-
width: auto;
|
|
338
|
-
}
|
|
339
|
-
:global(.h-6) {
|
|
340
|
-
height: 1.5rem;
|
|
341
|
-
}
|
|
342
|
-
:global(.w-6) {
|
|
343
|
-
width: 1.5rem;
|
|
344
|
-
}
|
|
345
|
-
:global(.shrink-0) {
|
|
346
|
-
flex-shrink: 0;
|
|
347
|
-
}
|
|
348
|
-
:global(.stroke-current) {
|
|
349
|
-
stroke: currentColor;
|
|
350
|
-
}
|
|
351
|
-
:global(.sr-only) {
|
|
352
|
-
position: absolute;
|
|
353
|
-
width: 1px;
|
|
354
|
-
height: 1px;
|
|
355
|
-
padding: 0;
|
|
356
|
-
margin: -1px;
|
|
357
|
-
overflow: hidden;
|
|
358
|
-
clip: rect(0, 0, 0, 0);
|
|
359
|
-
white-space: nowrap;
|
|
360
|
-
border-width: 0;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
/* Form inputs */
|
|
364
|
-
:global(.file-input) {
|
|
365
|
-
border-radius: 0.6rem;
|
|
366
|
-
border: 1px solid var(--color-base-300, oklch(95% 0 0));
|
|
367
|
-
background: var(--color-base-100, oklch(100% 0 0));
|
|
368
|
-
color: var(--color-base-content, oklch(21% 0 0));
|
|
369
|
-
padding: 0.35rem 0.6rem;
|
|
370
|
-
font: inherit;
|
|
371
|
-
}
|
|
372
|
-
:global(.file-input-bordered) {
|
|
373
|
-
border: 1px solid var(--color-base-300, oklch(95% 0 0));
|
|
374
|
-
}
|
|
375
|
-
:global(.label) {
|
|
376
|
-
display: flex;
|
|
377
|
-
user-select: none;
|
|
378
|
-
padding: 0.25rem 0;
|
|
379
|
-
}
|
|
380
|
-
:global(.label-text) {
|
|
381
|
-
font-size: 0.875rem;
|
|
382
|
-
line-height: 1.25rem;
|
|
383
|
-
}
|
|
384
|
-
:global(.form-control) {
|
|
385
|
-
display: flex;
|
|
386
|
-
flex-direction: column;
|
|
387
|
-
}
|
|
388
|
-
</style>
|
|
389
|
-
|
|
390
|
-
|