@luscii-healthtech/web-ui 37.7.0 → 38.0.1

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.
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import type { Delta, EmitterSource } from "quill/core";
3
+ import "quill-paste-smart";
3
4
  import "quill/dist/quill.snow.css";
4
5
  import "./TextEditor.scss";
5
6
  type Props = React.HTMLAttributes<HTMLDivElement> & {
@@ -57,10 +58,6 @@ type Props = React.HTMLAttributes<HTMLDivElement> & {
57
58
  * Placeholder text to show in the editor when it is empty.
58
59
  */
59
60
  placeholder?: string;
60
- /**
61
- * Allow inline styles in the editor when pasting from clipboard.
62
- */
63
- allowInlineStyle?: boolean;
64
61
  };
65
62
  type TextEditorToolbarOption = "bold" | "italic" | "underline" | "strike" | "link" | "video" | {
66
63
  list: "ordered";
@@ -1,8 +1,9 @@
1
- import React, { type ReactNode } from "react";
1
+ import React, { type ComponentProps, type ReactNode } from "react";
2
2
  import { Text } from "../Text/Text";
3
3
  import { Divider } from "../Divider/Divider";
4
4
  import { DetailsDisclosure } from "../DetailsDisclosure/DetailsDisclosure";
5
- type Props = React.ComponentPropsWithoutRef<"div"> & {
5
+ import type { Box } from "../Box/Box";
6
+ type Props = Omit<ComponentProps<typeof Box<"div">>, "as"> & {
6
7
  /**
7
8
  * Renders above the menu items, but below the header.
8
9
  */
@@ -29,6 +29,7 @@ var ReactSelect = require('react-select');
29
29
  var groupBy = require('lodash/groupBy');
30
30
  var RadixSwitch = require('@radix-ui/react-switch');
31
31
  var Quill = require('quill');
32
+ require('quill-paste-smart');
32
33
  require('quill/dist/quill.snow.css');
33
34
  var react = require('@headlessui/react');
34
35
  var solid = require('@heroicons/react/20/solid');
@@ -6113,7 +6114,7 @@ const TextEditor = (_a) => {
6113
6114
  ["bold", "italic", "underline", "strike"],
6114
6115
  [{ list: "ordered" }, { list: "bullet" }],
6115
6116
  ["link"]
6116
- ], placeholder, onValueChange, allowInlineStyle = false } = _a, attrs = __rest(_a, ["defaultValue", "formats", "toolbar", "placeholder", "onValueChange", "allowInlineStyle"]);
6117
+ ], placeholder, onValueChange } = _a, attrs = __rest(_a, ["defaultValue", "formats", "toolbar", "placeholder", "onValueChange"]);
6117
6118
  const defaultValueRef = React.useRef(defaultValue);
6118
6119
  const onTextChangeRef = React.useRef(onValueChange);
6119
6120
  const editorRef = React.useRef(null);
@@ -6133,25 +6134,8 @@ const TextEditor = (_a) => {
6133
6134
  });
6134
6135
  quill.on(Quill__default.default.events.TEXT_CHANGE, (value, _, source) => {
6135
6136
  var _a2;
6136
- (_a2 = onTextChangeRef.current) === null || _a2 === void 0 ? void 0 : _a2.call(onTextChangeRef, !allowInlineStyle ? DOMPurify__default.default.sanitize(quill.getSemanticHTML(), {
6137
- FORBID_ATTR: ["style"]
6138
- }) : quill.getSemanticHTML(), value, source);
6137
+ (_a2 = onTextChangeRef.current) === null || _a2 === void 0 ? void 0 : _a2.call(onTextChangeRef, quill.getSemanticHTML(), value, source);
6139
6138
  });
6140
- if (!allowInlineStyle) {
6141
- quill.clipboard.addMatcher(Node.ELEMENT_NODE, (_, delta) => {
6142
- const ops = [];
6143
- const newDelta = delta;
6144
- newDelta.ops.forEach((op) => {
6145
- if (op === null || op === void 0 ? void 0 : op.attributes) {
6146
- delete op.attributes.color;
6147
- delete op.attributes.background;
6148
- ops.push(op);
6149
- }
6150
- });
6151
- newDelta.ops = ops;
6152
- return newDelta;
6153
- });
6154
- }
6155
6139
  if (defaultValueRef.current) {
6156
6140
  quill.setContents(quill.clipboard.convert({
6157
6141
  html: defaultValueRef.current
@@ -6411,8 +6395,8 @@ const VerticalMenu = (props) => {
6411
6395
  context.Provider,
6412
6396
  { value: { variant } },
6413
6397
  React__namespace.default.createElement(
6414
- "div",
6415
- Object.assign({ className: classNames__default.default("ui-flex ui-h-full ui-flex-col ui-px-xxs ui-py-m ui-text-slate-800", className) }, rest),
6398
+ Stack,
6399
+ Object.assign({ as: "div", px: "xxs", py: "m", align: "normal", className: classNames__default.default("ui-h-full ui-text-slate-800", className) }, rest),
6416
6400
  header && React__namespace.default.createElement("div", null, header),
6417
6401
  title && React__namespace.default.createElement(Text, { className: classNames__default.default({ "ui-px-m": variant === "primary" }, "ui-pb-m ui-pt-xs"), variant: "lg-strong" }, title),
6418
6402
  React__namespace.default.createElement("div", null, props.children),