@domternal/core 0.7.0 → 0.7.2
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/README.md +1 -1
- package/dist/index.cjs +16 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -28
- package/dist/index.d.ts +43 -28
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Use it headless with vanilla JS/TS, add the built-in toolbar and theme, or drop
|
|
|
8
8
|
|
|
9
9
|
## Links
|
|
10
10
|
|
|
11
|
-
<u>[Website](https://domternal.dev)</u> • <u>[Documentation](https://domternal.dev/v1/introduction)</u>
|
|
11
|
+
<u>[Website](https://domternal.dev)</u> • <u>[Documentation](https://domternal.dev/v1/introduction)</u> •
|
|
12
12
|
<u>[StackBlitz (Angular)](https://stackblitz.com/edit/domternal-angular-full-example)</u> • <u>[StackBlitz (React)](https://stackblitz.com/edit/domternal-react-full-example)</u> • <u>[StackBlitz (Vue)](https://stackblitz.com/edit/domternal-vue-full-example)</u> • <u>[StackBlitz (Vanilla TS)](https://stackblitz.com/edit/domternal-vanilla-full-example)</u>
|
|
13
13
|
|
|
14
14
|
## Features
|
package/dist/index.cjs
CHANGED
|
@@ -4035,6 +4035,20 @@ async function writeToClipboard(text) {
|
|
|
4035
4035
|
}
|
|
4036
4036
|
}
|
|
4037
4037
|
|
|
4038
|
+
// src/utils/copyThemeClass.ts
|
|
4039
|
+
function copyThemeClass(view, target) {
|
|
4040
|
+
const stale = [];
|
|
4041
|
+
target.classList.forEach((cls) => {
|
|
4042
|
+
if (cls.startsWith("dm-theme-")) stale.push(cls);
|
|
4043
|
+
});
|
|
4044
|
+
for (const cls of stale) target.classList.remove(cls);
|
|
4045
|
+
const source = view.dom.closest('[class*="dm-theme-"]') ?? view.dom.closest(".dm-editor");
|
|
4046
|
+
if (!source) return;
|
|
4047
|
+
source.classList.forEach((cls) => {
|
|
4048
|
+
if (cls.startsWith("dm-theme-")) target.classList.add(cls);
|
|
4049
|
+
});
|
|
4050
|
+
}
|
|
4051
|
+
|
|
4038
4052
|
// src/utils/defaultBubbleContexts.ts
|
|
4039
4053
|
var NOTION_MODE_CLASS = "dm-notion-mode";
|
|
4040
4054
|
var NOTION_TEXT_CONTEXT = Object.freeze([
|
|
@@ -9534,6 +9548,7 @@ function linkPopoverPlugin({ editor, markType, protocols }) {
|
|
|
9534
9548
|
} else if (el.parentElement !== document.body) {
|
|
9535
9549
|
document.body.appendChild(el);
|
|
9536
9550
|
}
|
|
9551
|
+
copyThemeClass(editor.view, el);
|
|
9537
9552
|
cleanupFloating?.();
|
|
9538
9553
|
cleanupFloating = positionFloating(reference, el, {
|
|
9539
9554
|
placement: anchorElement ? "bottom-start" : "bottom",
|
|
@@ -10107,6 +10122,7 @@ exports.builtInCommands = builtInCommands;
|
|
|
10107
10122
|
exports.callOrReturn = callOrReturn;
|
|
10108
10123
|
exports.characterCountPluginKey = characterCountPluginKey;
|
|
10109
10124
|
exports.clearContent = clearContent;
|
|
10125
|
+
exports.copyThemeClass = copyThemeClass;
|
|
10110
10126
|
exports.createAccumulatingDispatch = createAccumulatingDispatch;
|
|
10111
10127
|
exports.createBubbleMenuPlugin = createBubbleMenuPlugin;
|
|
10112
10128
|
exports.createCanChecker = createCanChecker;
|