@crystallize/design-system 1.7.0 → 1.9.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/CHANGELOG.md +13 -0
- package/dist/index.css +53 -332
- package/dist/index.d.ts +15 -8
- package/dist/index.js +1717 -4568
- package/dist/index.mjs +1639 -2355
- package/package.json +1 -1
- package/src/action-menu/action-item-separator.tsx +14 -0
- package/src/action-menu/action-item.tsx +2 -2
- package/src/action-menu/action-menu.css +8 -0
- package/src/action-menu/action-menu.tsx +2 -1
- package/src/dropdown-menu/dropdown-menu-root.tsx +3 -1
- package/src/dropdown-menu/index.ts +5 -2
- package/src/iconography/subscription-contracts.tsx +4 -4
- package/src/iconography/subscription-plans.tsx +5 -5
- package/src/rich-text-editor/model/crystallize-to-lexical.ts +12 -1
- package/src/rich-text-editor/model/lexical-to-crystallize.ts +38 -38
- package/src/rich-text-editor/nodes/BaseNodes.ts +0 -7
- package/src/rich-text-editor/nodes/TableCellNodes.ts +0 -7
- package/src/rich-text-editor/plugins/ActionsPlugin/index.tsx +1 -1
- package/src/rich-text-editor/plugins/CodeActionMenuPlugin/components/CopyButton/index.tsx +3 -2
- package/src/rich-text-editor/plugins/CodeActionMenuPlugin/components/PrettierButton/index.tsx +0 -1
- package/src/rich-text-editor/plugins/FloatingTextFormatToolbarPlugin/index.css +17 -17
- package/src/rich-text-editor/plugins/FloatingTextFormatToolbarPlugin/index.tsx +1 -1
- package/src/rich-text-editor/plugins/MaxLengthPlugin/index.tsx +2 -7
- package/src/rich-text-editor/plugins/TableActionMenuPlugin/index.tsx +80 -149
- package/src/rich-text-editor/plugins/ToolbarPlugin/index.tsx +23 -36
- package/src/rich-text-editor/plugins/ToolbarPlugin/insert-table.tsx +55 -0
- package/src/rich-text-editor/rich-text-editor.css +10 -322
- package/src/rich-text-editor/rich-text-editor.stories.tsx +35 -5
- package/src/rich-text-editor/rich-text-editor.tsx +6 -39
- package/src/rich-text-editor/tests/rich-text-editor-code.test.tsx +10 -6
- package/src/rich-text-editor/tests/rich-text-editor-model-conversions.test.tsx +19 -7
- package/src/rich-text-editor/themes/CrystallizeRTEditorTheme.css +3 -11
- package/dist/TableComponent-I2YOOYOU.css +0 -281
- package/dist/TableComponent-QINOO453.mjs +0 -1377
- package/dist/chevron-down-3FRWSIKS.svg +0 -1
- package/dist/chunk-VUXQZRSP.mjs +0 -737
- package/dist/markdown-4BGQNLLT.svg +0 -1
- package/src/rich-text-editor/nodes/KeywordNode.ts +0 -73
- package/src/rich-text-editor/nodes/TableComponent.tsx +0 -1547
- package/src/rich-text-editor/nodes/TableNode.tsx +0 -398
- package/src/rich-text-editor/plugins/ComponentPickerPlugin/index.tsx +0 -320
- package/src/rich-text-editor/plugins/DragDropPastePlugin/index.ts +0 -40
- package/src/rich-text-editor/plugins/MarkdownShortcutPlugin/index.tsx +0 -16
- package/src/rich-text-editor/plugins/MarkdownTransformers/index.ts +0 -195
- package/src/rich-text-editor/plugins/SpeechToTextPlugin/index.ts +0 -113
- package/src/rich-text-editor/plugins/TableCellResizer/index.css +0 -12
- package/src/rich-text-editor/plugins/TableCellResizer/index.tsx +0 -386
- package/src/rich-text-editor/plugins/TablePlugin.tsx +0 -190
- package/src/rich-text-editor/plugins/TreeViewPlugin/index.tsx +0 -25
- package/src/rich-text-editor/plugins/TypingPerfPlugin/index.ts +0 -117
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-markdown"><path d="M14 3a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h12zM2 2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H2z"/><path fill-rule="evenodd" d="M9.146 8.146a.5.5 0 0 1 .708 0L11.5 9.793l1.646-1.647a.5.5 0 0 1 .708.708l-2 2a.5.5 0 0 1-.708 0l-2-2a.5.5 0 0 1 0-.708z"/><path fill-rule="evenodd" d="M11.5 5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 1 .5-.5z"/><path d="M3.56 11V7.01h.056l1.428 3.239h.774l1.42-3.24h.056V11h1.073V5.001h-1.2l-1.71 3.894h-.039l-1.71-3.894H2.5V11h1.06z"/></svg>
|
|
@@ -1,73 +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 type { EditorConfig, LexicalNode, SerializedTextNode, Spread } from 'lexical';
|
|
10
|
-
|
|
11
|
-
import { TextNode } from 'lexical';
|
|
12
|
-
|
|
13
|
-
export type SerializedKeywordNode = Spread<
|
|
14
|
-
{
|
|
15
|
-
type: 'keyword';
|
|
16
|
-
version: 1;
|
|
17
|
-
},
|
|
18
|
-
SerializedTextNode
|
|
19
|
-
>;
|
|
20
|
-
|
|
21
|
-
export class KeywordNode extends TextNode {
|
|
22
|
-
static getType(): string {
|
|
23
|
-
return 'keyword';
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static clone(node: KeywordNode): KeywordNode {
|
|
27
|
-
return new KeywordNode(node.__text, node.__key);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static importJSON(serializedNode: SerializedKeywordNode): KeywordNode {
|
|
31
|
-
const node = $createKeywordNode(serializedNode.text);
|
|
32
|
-
node.setFormat(serializedNode.format);
|
|
33
|
-
node.setDetail(serializedNode.detail);
|
|
34
|
-
node.setMode(serializedNode.mode);
|
|
35
|
-
node.setStyle(serializedNode.style);
|
|
36
|
-
return node;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
exportJSON(): SerializedKeywordNode {
|
|
40
|
-
return {
|
|
41
|
-
...super.exportJSON(),
|
|
42
|
-
type: 'keyword',
|
|
43
|
-
version: 1,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
createDOM(config: EditorConfig): HTMLElement {
|
|
48
|
-
const dom = super.createDOM(config);
|
|
49
|
-
dom.style.cursor = 'default';
|
|
50
|
-
dom.className = 'keyword';
|
|
51
|
-
return dom;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
canInsertTextBefore(): boolean {
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
canInsertTextAfter(): boolean {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
isTextEntity(): true {
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function $createKeywordNode(keyword: string): KeywordNode {
|
|
68
|
-
return new KeywordNode(keyword);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export function $isKeywordNode(node: LexicalNode | null | undefined | undefined): boolean {
|
|
72
|
-
return node instanceof KeywordNode;
|
|
73
|
-
}
|