@bendyline/squisq-editor-react 0.1.1 → 1.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.
- package/dist/index.js +41 -33
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/Toolbar.tsx +50 -45
- package/src/styles/editor.css +21 -0
package/dist/index.js
CHANGED
|
@@ -472,43 +472,51 @@ function Toolbar({ className }) {
|
|
|
472
472
|
},
|
|
473
473
|
view.id
|
|
474
474
|
)) }),
|
|
475
|
-
!isPreview && /* @__PURE__ */
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
/* @__PURE__ */ jsxs(
|
|
500
|
-
"select",
|
|
475
|
+
!isPreview && /* @__PURE__ */ jsxs("div", { className: "squisq-toolbar-actions", children: [
|
|
476
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs("div", { className: "squisq-toolbar-group", children: [
|
|
477
|
+
gi > 0 && /* @__PURE__ */ jsx2("div", { className: "squisq-toolbar-separator" }),
|
|
478
|
+
BUTTONS.filter((b) => b.group === group).map((btn) => {
|
|
479
|
+
const active = isWysiwyg ? isTiptapActive(tiptapEditor, btn.id) : false;
|
|
480
|
+
return /* @__PURE__ */ jsx2(
|
|
481
|
+
"button",
|
|
482
|
+
{
|
|
483
|
+
className: `squisq-toolbar-button${active ? " squisq-toolbar-button--active" : ""}`,
|
|
484
|
+
title: btn.title,
|
|
485
|
+
onClick: () => handleAction(btn.id),
|
|
486
|
+
"aria-label": btn.title,
|
|
487
|
+
"aria-pressed": active,
|
|
488
|
+
style: btn.iconStyle,
|
|
489
|
+
children: btn.icon
|
|
490
|
+
},
|
|
491
|
+
btn.id
|
|
492
|
+
);
|
|
493
|
+
})
|
|
494
|
+
] }, group)),
|
|
495
|
+
currentTemplate !== null && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
496
|
+
/* @__PURE__ */ jsx2("div", { className: "squisq-toolbar-separator" }),
|
|
497
|
+
/* @__PURE__ */ jsx2("div", { className: "squisq-toolbar-group squisq-template-picker", children: /* @__PURE__ */ jsxs(
|
|
498
|
+
"label",
|
|
501
499
|
{
|
|
502
|
-
className: "squisq-template-picker-
|
|
503
|
-
|
|
504
|
-
onChange: (e) => handleTemplatePick(e.target.value),
|
|
500
|
+
className: "squisq-template-picker-label",
|
|
501
|
+
title: "Block template for this heading",
|
|
505
502
|
children: [
|
|
506
|
-
|
|
507
|
-
|
|
503
|
+
"Template:",
|
|
504
|
+
/* @__PURE__ */ jsxs(
|
|
505
|
+
"select",
|
|
506
|
+
{
|
|
507
|
+
className: "squisq-template-picker-select",
|
|
508
|
+
value: currentTemplate,
|
|
509
|
+
onChange: (e) => handleTemplatePick(e.target.value),
|
|
510
|
+
children: [
|
|
511
|
+
/* @__PURE__ */ jsx2("option", { value: "", children: "\u2014 none \u2014" }),
|
|
512
|
+
templateNames.map((name) => /* @__PURE__ */ jsx2("option", { value: name, children: name }, name))
|
|
513
|
+
]
|
|
514
|
+
}
|
|
515
|
+
)
|
|
508
516
|
]
|
|
509
517
|
}
|
|
510
|
-
)
|
|
511
|
-
] })
|
|
518
|
+
) })
|
|
519
|
+
] })
|
|
512
520
|
] })
|
|
513
521
|
]
|
|
514
522
|
}
|