@pretextbook/web-editor 0.0.3 → 0.0.5
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 +9 -3
- package/dist/components/FullPreview.d.ts +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +16 -16
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/web-editor.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,14 +40,20 @@ export default App;
|
|
|
40
40
|
|
|
41
41
|
### Styling
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
**Important:** This package uses Tailwind CSS internally, but **all styles are pre-compiled and bundled** in the CSS file. You don't need to install or configure Tailwind CSS in your project.
|
|
44
|
+
|
|
45
|
+
Simply import the CSS file:
|
|
44
46
|
|
|
45
|
-
**Option 1: Import the CSS file directly** (recommended)
|
|
46
47
|
```tsx
|
|
47
48
|
import '@pretextbook/web-editor/dist/web-editor.css';
|
|
48
49
|
```
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
Or in your CSS file:
|
|
52
|
+
```css
|
|
53
|
+
@import '@pretextbook/web-editor/dist/web-editor.css';
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
All button styles, layout, and MenuBar styling will work automatically without any additional setup.
|
|
51
57
|
```css
|
|
52
58
|
@import '@pretextbook/web-editor/dist/web-editor.css';
|
|
53
59
|
```
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
interface FullPreviewProps {
|
|
2
2
|
content: string;
|
|
3
|
+
title?: string;
|
|
3
4
|
}
|
|
4
|
-
declare const FullPreview: ({ content }: FullPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare const FullPreview: ({ content, title }: FullPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
export default FullPreview;
|
package/dist/index.d.ts
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -36307,20 +36307,20 @@ const jx = Me.create({
|
|
|
36307
36307
|
/* @__PURE__ */ X.jsx("div", { className: (s ? "editable" : "read-only") + " ptx-page", children: /* @__PURE__ */ X.jsx(k7, { editor: n }) }),
|
|
36308
36308
|
/* @__PURE__ */ X.jsx(Lx, { editor: n })
|
|
36309
36309
|
] });
|
|
36310
|
-
}, Wx = ({ content: r }) => {
|
|
36311
|
-
const
|
|
36312
|
-
const
|
|
36313
|
-
|
|
36314
|
-
for (const
|
|
36315
|
-
if (Object.hasOwnProperty.call(
|
|
36316
|
-
const
|
|
36317
|
-
|
|
36318
|
-
}
|
|
36319
|
-
document.body.appendChild(
|
|
36320
|
-
},
|
|
36321
|
-
const
|
|
36322
|
-
let
|
|
36323
|
-
|
|
36310
|
+
}, Wx = ({ content: r, title: e }) => {
|
|
36311
|
+
const t = (i, s, o) => {
|
|
36312
|
+
const a = document.createElement("form");
|
|
36313
|
+
a.method = "POST", a.action = i, a.target = o, a.style.display = "none";
|
|
36314
|
+
for (const l in s)
|
|
36315
|
+
if (Object.hasOwnProperty.call(s, l)) {
|
|
36316
|
+
const u = document.createElement("input");
|
|
36317
|
+
u.type = "hidden", u.name = l, u.value = s[l], a.appendChild(u);
|
|
36318
|
+
}
|
|
36319
|
+
document.body.appendChild(a), a.submit(), a.remove();
|
|
36320
|
+
}, n = () => {
|
|
36321
|
+
const i = r, s = e || "Document Title";
|
|
36322
|
+
let o = window.buildToken;
|
|
36323
|
+
o === void 0 && (o = void 0), t("https://build.pretext.plus", { source: i, title: s, token: o }, "fullPreview");
|
|
36324
36324
|
};
|
|
36325
36325
|
return /* @__PURE__ */ X.jsxs("div", { className: "editor-panel", children: [
|
|
36326
36326
|
/* @__PURE__ */ X.jsxs("div", { className: "relative mb-2 flex items-center justify-center pt-2", children: [
|
|
@@ -36329,7 +36329,7 @@ const jx = Me.create({
|
|
|
36329
36329
|
"button",
|
|
36330
36330
|
{
|
|
36331
36331
|
className: "absolute right-0 rounded-sm px-3 py-1.5 text-xs font-semibold text-white bg-emerald-600 hover:bg-emerald-700 shadow-sm transition-colors",
|
|
36332
|
-
onClick: () =>
|
|
36332
|
+
onClick: () => n(),
|
|
36333
36333
|
children: "Rebuild"
|
|
36334
36334
|
}
|
|
36335
36335
|
)
|
|
@@ -36494,7 +36494,7 @@ const jx = Me.create({
|
|
|
36494
36494
|
`, Kx = Gx, Xx = (r) => {
|
|
36495
36495
|
const [e, t] = Ct(r.content || Kx), [n, i] = Ct(r.title || "Document Title"), [s, o] = Ct(!1);
|
|
36496
36496
|
let a;
|
|
36497
|
-
return s ? a = /* @__PURE__ */ X.jsx(Wx, { content: e }) : a = /* @__PURE__ */ X.jsx(
|
|
36497
|
+
return s ? a = /* @__PURE__ */ X.jsx(Wx, { content: e, title: n }) : a = /* @__PURE__ */ X.jsx(
|
|
36498
36498
|
_x,
|
|
36499
36499
|
{
|
|
36500
36500
|
content: e,
|