@crystallize/design-system 1.9.0 → 1.11.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.
Files changed (30) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/index.css +15 -17
  3. package/dist/index.d.ts +10 -3
  4. package/dist/index.js +528 -470
  5. package/dist/index.mjs +477 -423
  6. package/package.json +1 -1
  7. package/src/rich-text-editor/i18n/i18n.test.ts +14 -0
  8. package/src/rich-text-editor/i18n/index.tsx +64 -0
  9. package/src/rich-text-editor/i18n/translations/en.ts +66 -0
  10. package/src/rich-text-editor/i18n/types.ts +62 -0
  11. package/src/rich-text-editor/model/crystallize-to-lexical.ts +29 -1
  12. package/src/rich-text-editor/model/lexical-to-crystallize.ts +54 -29
  13. package/src/rich-text-editor/plugins/ActionsPlugin/index.tsx +5 -22
  14. package/src/rich-text-editor/plugins/CodeActionMenuPlugin/components/CopyButton/index.tsx +4 -1
  15. package/src/rich-text-editor/plugins/CodeActionMenuPlugin/components/PrettierButton/index.tsx +11 -1
  16. package/src/rich-text-editor/plugins/CodeActionMenuPlugin/index.tsx +2 -1
  17. package/src/rich-text-editor/plugins/FloatingLinkEditorPlugin/index.tsx +23 -5
  18. package/src/rich-text-editor/plugins/FloatingTextFormatToolbarPlugin/index.tsx +21 -10
  19. package/src/rich-text-editor/plugins/TabFocusPlugin/index.tsx +4 -12
  20. package/src/rich-text-editor/plugins/TableActionMenuPlugin/index.tsx +23 -14
  21. package/src/rich-text-editor/plugins/ToolbarPlugin/index.tsx +33 -33
  22. package/src/rich-text-editor/plugins/ToolbarPlugin/insert-table.tsx +6 -4
  23. package/src/rich-text-editor/rich-text-editor.css +6 -0
  24. package/src/rich-text-editor/rich-text-editor.stories.tsx +38 -0
  25. package/src/rich-text-editor/rich-text-editor.tsx +15 -9
  26. package/src/rich-text-editor/tests/rich-text-editor-model-conversions.test.tsx +23 -1
  27. package/src/rich-text-editor/types/crystallize-rich-text-types/index.ts +2 -4
  28. package/src/rich-text-editor/ui/LinkPreview.tsx +3 -1
  29. package/src/rich-text-editor/ui/ContentEditable.css +0 -13
  30. package/src/rich-text-editor/ui/ContentEditable.tsx +0 -15
@@ -12,6 +12,7 @@ import { $getSelection, $isTextNode } from 'lexical';
12
12
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
13
13
 
14
14
  import { Button } from '../../button';
15
+ import { useTr } from '../i18n';
15
16
 
16
17
  type MetaTagBaseShared = {
17
18
  description?: string;
@@ -77,6 +78,7 @@ function LinkPreviewContent({
77
78
  const [textContent, setTextContent] = useState('');
78
79
  const { preview } = useSuspenseRequest(url);
79
80
  const [editor] = useLexicalComposerContext();
81
+ const tr = useTr();
80
82
 
81
83
  const hasPreview = preview !== null && preview.google?.title;
82
84
 
@@ -128,7 +130,7 @@ function LinkPreviewContent({
128
130
  {preview.google.description && <div className="LinkPreview__description">{preview.google.description}</div>}
129
131
  {textContent && textContent !== preview.google.title ? (
130
132
  <Button className="mb-4 ml-5" onClick={useTitleForText}>
131
- Replace link text with its title
133
+ {tr('linkPreviewReplaceTextWithTitle')}
132
134
  </Button>
133
135
  ) : null}
134
136
  </div>
@@ -1,13 +0,0 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- */
9
- .ContentEditable__root {
10
- tab-size: 1;
11
- min-height: calc(100% - 16px);
12
- @apply relative block border-0 px-6 py-2 !pt-0 text-sm outline-0;
13
- }
@@ -1,15 +0,0 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
- import './ContentEditable.css';
10
- import * as React from 'react';
11
- import { ContentEditable } from '@lexical/react/LexicalContentEditable';
12
-
13
- export default function LexicalContentEditable({ className }: { className?: string }): JSX.Element {
14
- return <ContentEditable className={className || 'ContentEditable__root'} />;
15
- }