@dnax/ui 0.0.27 → 0.0.29
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/components/QBar.vue +42 -0
- package/components/QBoard.vue +285 -0
- package/components/QConfigProvider.vue +9 -5
- package/components/QDialog.vue +26 -12
- package/components/QEditorJs.vue +146 -0
- package/components/QFab.vue +19 -2
- package/components/QInteract.vue +387 -0
- package/components/QSpreadsheet.vue +4662 -0
- package/components/QSyntax.vue +22 -9
- package/components/QTiptap.vue +993 -0
- package/components/internal/QTiptapTableView.vue +123 -0
- package/components/internal/QTiptapTaskItemView.vue +49 -0
- package/index.ts +18 -0
- package/lib/config.ts +6 -0
- package/lib/formula.test.ts +206 -0
- package/lib/formula.ts +292 -0
- package/lib/icons.ts +43 -0
- package/lib/intersection.ts +118 -0
- package/lib/q.ts +5 -1
- package/lib/spreadsheet.test.ts +92 -0
- package/lib/spreadsheet.ts +175 -0
- package/lib/storage.ts +175 -0
- package/lib/tiptap-table.ts +19 -0
- package/lib/tiptap-task-list.ts +16 -0
- package/lib/touchHold.ts +221 -0
- package/lib/touchPan.ts +237 -0
- package/lib/touchRepeat.ts +148 -0
- package/lib/touchSwipe.ts +182 -0
- package/lib/useComponentProps.ts +7 -0
- package/module.ts +10 -0
- package/package.json +27 -1
- package/scripts/generate-exports.ts +12 -0
- package/styles/main.css +2217 -32
package/components/QSyntax.vue
CHANGED
|
@@ -63,15 +63,28 @@ const slotCode = computed(() => {
|
|
|
63
63
|
|
|
64
64
|
const source = computed(() => props.code ?? slotCode.value)
|
|
65
65
|
|
|
66
|
-
// Highlighter singleton : une seule instance pour toute l'application
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
66
|
+
// Highlighter singleton : une seule instance pour toute l'application.
|
|
67
|
+
// Stocké sur globalThis (et non au scope module) pour survivre aux
|
|
68
|
+
// réévaluations du module (HMR — édition de QSyntax.vue ou de ses imports,
|
|
69
|
+
// ex. lib/icons.ts) : sinon une instance orpheline est créée à chaque cycle
|
|
70
|
+
// et Shiki avertit (« [Shiki] N instances have been created… »).
|
|
71
|
+
const SHIKI_KEY = "__dnax_ui_shiki_highlighter__"
|
|
72
|
+
const getHighlighter = (): Promise<Highlighter> => {
|
|
73
|
+
const g = globalThis as { [SHIKI_KEY]?: Promise<Highlighter> }
|
|
74
|
+
let highlighter = g[SHIKI_KEY]
|
|
75
|
+
if (!highlighter) {
|
|
76
|
+
highlighter = createHighlighter({
|
|
77
|
+
themes: [DEFAULT_THEME],
|
|
78
|
+
langs: DEFAULT_LANGS,
|
|
79
|
+
engine: createJavaScriptRegexEngine(),
|
|
80
|
+
}).catch((error: unknown) => {
|
|
81
|
+
// Une création en échec ne doit pas bloquer les montages suivants
|
|
82
|
+
delete g[SHIKI_KEY]
|
|
83
|
+
throw error
|
|
84
|
+
})
|
|
85
|
+
g[SHIKI_KEY] = highlighter
|
|
86
|
+
}
|
|
87
|
+
return highlighter
|
|
75
88
|
}
|
|
76
89
|
|
|
77
90
|
const html = ref("")
|