@collabchron/notiq 0.2.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 (188) hide show
  1. package/README.md +71 -0
  2. package/components.json +21 -0
  3. package/eslint.config.mjs +16 -0
  4. package/next.config.ts +12 -0
  5. package/package.json +108 -0
  6. package/postcss.config.mjs +5 -0
  7. package/public/file.svg +1 -0
  8. package/public/globe.svg +1 -0
  9. package/public/images/icons/plus.svg +10 -0
  10. package/public/next.svg +1 -0
  11. package/public/vercel.svg +1 -0
  12. package/public/window.svg +1 -0
  13. package/src/app/actions.ts +2 -0
  14. package/src/app/api/ai/route.ts +175 -0
  15. package/src/app/api/edgestore/[...edgestore]/route.ts +28 -0
  16. package/src/app/favicon.ico +0 -0
  17. package/src/app/globals.css +205 -0
  18. package/src/app/layout.tsx +38 -0
  19. package/src/app/page.tsx +12 -0
  20. package/src/components/editor/Core.tsx +220 -0
  21. package/src/components/editor/hooks/instructions-messages.ts +300 -0
  22. package/src/components/editor/hooks/use-mobile.ts +19 -0
  23. package/src/components/editor/hooks/useReport.ts +67 -0
  24. package/src/components/editor/hooks/useResizeObservert.ts +22 -0
  25. package/src/components/editor/index.tsx +39 -0
  26. package/src/components/editor/lexical-on-change.tsx +28 -0
  27. package/src/components/editor/nodes/CollapsibleNode/CollapsibleContainerNode.ts +92 -0
  28. package/src/components/editor/nodes/CollapsibleNode/CollapsibleContentNode.ts +65 -0
  29. package/src/components/editor/nodes/CollapsibleNode/CollapsibleTitleNode.ts +105 -0
  30. package/src/components/editor/nodes/EquationNode/EquationComponent.tsx +143 -0
  31. package/src/components/editor/nodes/EquationNode/EquationNode.tsx +170 -0
  32. package/src/components/editor/nodes/ExcalidrawNode/ExcalidrawComponent.tsx +228 -0
  33. package/src/components/editor/nodes/ExcalidrawNode/ExcalidrawImage.tsx +137 -0
  34. package/src/components/editor/nodes/ExcalidrawNode/ImageResizer.tsx +317 -0
  35. package/src/components/editor/nodes/ExcalidrawNode/index.tsx +204 -0
  36. package/src/components/editor/nodes/FigmaNode/FigmaNode.tsx +134 -0
  37. package/src/components/editor/nodes/Hint/HintComponet.tsx +221 -0
  38. package/src/components/editor/nodes/Hint/index.tsx +190 -0
  39. package/src/components/editor/nodes/ImageNode/index.tsx +328 -0
  40. package/src/components/editor/nodes/InlineImageNode/InlineImageComponent.tsx +383 -0
  41. package/src/components/editor/nodes/InlineImageNode/InlineImageNode.css +94 -0
  42. package/src/components/editor/nodes/InlineImageNode/InlineImageNode.tsx +309 -0
  43. package/src/components/editor/nodes/LayoutNode/LayoutContainerNode.ts +146 -0
  44. package/src/components/editor/nodes/LayoutNode/LayoutItemNode.ts +79 -0
  45. package/src/components/editor/nodes/PollNode/index.tsx +204 -0
  46. package/src/components/editor/nodes/Stepper/index.tsx +260 -0
  47. package/src/components/editor/nodes/TweetNode/index.tsx +214 -0
  48. package/src/components/editor/nodes/index.ts +81 -0
  49. package/src/components/editor/plugins/AutoEmbedPlugin/index.tsx +350 -0
  50. package/src/components/editor/plugins/AutoLinkPlugin/index.tsx +56 -0
  51. package/src/components/editor/plugins/CodeActionMenuPlugin/components/CopyButton.tsx +70 -0
  52. package/src/components/editor/plugins/CodeActionMenuPlugin/components/PrettierButton.tsx +192 -0
  53. package/src/components/editor/plugins/CodeActionMenuPlugin/index.tsx +217 -0
  54. package/src/components/editor/plugins/CodeActionMenuPlugin/utils.ts +26 -0
  55. package/src/components/editor/plugins/CodeHighlightPlugin/index.ts +21 -0
  56. package/src/components/editor/plugins/CollapsiblePlugin/Collapsible.css +76 -0
  57. package/src/components/editor/plugins/CollapsiblePlugin/index.ts +228 -0
  58. package/src/components/editor/plugins/DragDropPastePlugin/index.tsx +44 -0
  59. package/src/components/editor/plugins/DraggableBlockPlugin/index.tsx +52 -0
  60. package/src/components/editor/plugins/EquationsPlugin/index.tsx +85 -0
  61. package/src/components/editor/plugins/ExcalidrawPlugin/index.tsx +98 -0
  62. package/src/components/editor/plugins/FigmaPlugin/index.tsx +42 -0
  63. package/src/components/editor/plugins/FloatingLinkEditorPlugin/index.tsx +445 -0
  64. package/src/components/editor/plugins/FloatingTextFormatToolbarPlugin/index.tsx +275 -0
  65. package/src/components/editor/plugins/ImagesPlugin/index.tsx +222 -0
  66. package/src/components/editor/plugins/InlineImagePlugin/index.tsx +351 -0
  67. package/src/components/editor/plugins/LayoutPlugin/index.tsx +238 -0
  68. package/src/components/editor/plugins/LinkPlugin/index.tsx +36 -0
  69. package/src/components/editor/plugins/LinkWithMetaData/index.tsx +271 -0
  70. package/src/components/editor/plugins/MarkdownShortcutPlugin/index.tsx +11 -0
  71. package/src/components/editor/plugins/MarkdownTransformers/index.tsx +304 -0
  72. package/src/components/editor/plugins/PollPlugin/index.tsx +49 -0
  73. package/src/components/editor/plugins/ShortcutsPlugin/index.tsx +180 -0
  74. package/src/components/editor/plugins/ShortcutsPlugin/shortcuts.ts +253 -0
  75. package/src/components/editor/plugins/SlashCommand/index.tsx +621 -0
  76. package/src/components/editor/plugins/SpeechToTextPlugin/index.ts +127 -0
  77. package/src/components/editor/plugins/TabFocusPlugin/index.ts +58 -0
  78. package/src/components/editor/plugins/TableCellActionMenuPlugin/index.tsx +759 -0
  79. package/src/components/editor/plugins/TableCellResizer/index.tsx +438 -0
  80. package/src/components/editor/plugins/TableHoverActionsPlugin/index.tsx +314 -0
  81. package/src/components/editor/plugins/TablePlugin/index.tsx +99 -0
  82. package/src/components/editor/plugins/ToolbarPlugin/index.tsx +522 -0
  83. package/src/components/editor/plugins/TwitterPlugin/index.ts +35 -0
  84. package/src/components/editor/plugins/YouTubeNode/index.tsx +179 -0
  85. package/src/components/editor/plugins/YouTubePlugin/index.ts +41 -0
  86. package/src/components/editor/themes/editor-theme.ts +113 -0
  87. package/src/components/editor/themes/theme.css +377 -0
  88. package/src/components/editor/utils/ai.ts +291 -0
  89. package/src/components/editor/utils/canUseDOM.ts +12 -0
  90. package/src/components/editor/utils/editorFormatting.ts +282 -0
  91. package/src/components/editor/utils/environment.ts +50 -0
  92. package/src/components/editor/utils/extract-data.ts +166 -0
  93. package/src/components/editor/utils/getAllLexicalChildren.ts +13 -0
  94. package/src/components/editor/utils/getDOMRangeRect.ts +27 -0
  95. package/src/components/editor/utils/getSelectedNode.ts +27 -0
  96. package/src/components/editor/utils/gif.ts +29 -0
  97. package/src/components/editor/utils/invariant.ts +15 -0
  98. package/src/components/editor/utils/setFloatingElemPosition.ts +51 -0
  99. package/src/components/editor/utils/setFloatingElemPositionForLinkEditor.ts +40 -0
  100. package/src/components/editor/utils/setNodePlaceholderFromSelection/getNodePlaceholder.ts +51 -0
  101. package/src/components/editor/utils/setNodePlaceholderFromSelection/setNodePlaceholderFromSelection.ts +15 -0
  102. package/src/components/editor/utils/setNodePlaceholderFromSelection/setPlaceholderOnSelection.ts +114 -0
  103. package/src/components/editor/utils/setNodePlaceholderFromSelection/styles.css +6 -0
  104. package/src/components/editor/utils/url.ts +109 -0
  105. package/src/components/editor/utils/useLayoutEffect.ts +13 -0
  106. package/src/components/providers/QueryProvider.tsx +15 -0
  107. package/src/components/providers/SharedHistoryContext.tsx +28 -0
  108. package/src/components/providers/ToolbarContext.tsx +123 -0
  109. package/src/components/providers/theme-provider.tsx +11 -0
  110. package/src/components/theme/ModeToggle.tsx +40 -0
  111. package/src/components/ui/FileInput.tsx +40 -0
  112. package/src/components/ui/Input.css +32 -0
  113. package/src/components/ui/Select.css +42 -0
  114. package/src/components/ui/Select.tsx +36 -0
  115. package/src/components/ui/TextInput.tsx +48 -0
  116. package/src/components/ui/ai/ai-button.tsx +574 -0
  117. package/src/components/ui/ai/border.tsx +99 -0
  118. package/src/components/ui/ai/placeholder-input-vanish.tsx +282 -0
  119. package/src/components/ui/button.tsx +89 -0
  120. package/src/components/ui/card.tsx +76 -0
  121. package/src/components/ui/checkbox.tsx +30 -0
  122. package/src/components/ui/command.tsx +153 -0
  123. package/src/components/ui/dialog/Dialog.css +25 -0
  124. package/src/components/ui/dialog/Dialog.tsx +34 -0
  125. package/src/components/ui/dialog.tsx +122 -0
  126. package/src/components/ui/drop-downs/background-color.tsx +183 -0
  127. package/src/components/ui/drop-downs/block-format.tsx +159 -0
  128. package/src/components/ui/drop-downs/code.tsx +42 -0
  129. package/src/components/ui/drop-downs/color.tsx +177 -0
  130. package/src/components/ui/drop-downs/font-size.tsx +138 -0
  131. package/src/components/ui/drop-downs/font.tsx +155 -0
  132. package/src/components/ui/drop-downs/index.tsx +122 -0
  133. package/src/components/ui/drop-downs/insert-node.tsx +213 -0
  134. package/src/components/ui/drop-downs/text-align.tsx +123 -0
  135. package/src/components/ui/drop-downs/text-format.tsx +104 -0
  136. package/src/components/ui/dropdown-menu.tsx +201 -0
  137. package/src/components/ui/equation/EquationEditor.css +38 -0
  138. package/src/components/ui/equation/EquationEditor.tsx +56 -0
  139. package/src/components/ui/equation/KatexEquationAlterer.css +41 -0
  140. package/src/components/ui/equation/KatexEquationAlterer.tsx +83 -0
  141. package/src/components/ui/equation/KatexRenderer.tsx +66 -0
  142. package/src/components/ui/excalidraw/ExcalidrawModal.css +64 -0
  143. package/src/components/ui/excalidraw/ExcalidrawModal.tsx +234 -0
  144. package/src/components/ui/excalidraw/Modal.css +62 -0
  145. package/src/components/ui/excalidraw/Modal.tsx +110 -0
  146. package/src/components/ui/hover-card.tsx +29 -0
  147. package/src/components/ui/image/error-image.tsx +17 -0
  148. package/src/components/ui/image/file-upload.tsx +240 -0
  149. package/src/components/ui/image/image-resizer.tsx +297 -0
  150. package/src/components/ui/image/image-toolbar.tsx +264 -0
  151. package/src/components/ui/image/index.tsx +408 -0
  152. package/src/components/ui/image/lazy-image.tsx +68 -0
  153. package/src/components/ui/image/lazy-video.tsx +71 -0
  154. package/src/components/ui/input.tsx +22 -0
  155. package/src/components/ui/models/custom-dialog.tsx +320 -0
  156. package/src/components/ui/models/insert-gif.tsx +90 -0
  157. package/src/components/ui/models/insert-image.tsx +52 -0
  158. package/src/components/ui/models/insert-poll.tsx +29 -0
  159. package/src/components/ui/models/insert-table.tsx +62 -0
  160. package/src/components/ui/models/use-model.tsx +91 -0
  161. package/src/components/ui/poll/poll-component.tsx +304 -0
  162. package/src/components/ui/popover.tsx +33 -0
  163. package/src/components/ui/progress.tsx +28 -0
  164. package/src/components/ui/scroll-area.tsx +48 -0
  165. package/src/components/ui/separator.tsx +31 -0
  166. package/src/components/ui/skeleton.tsx +15 -0
  167. package/src/components/ui/sonner.tsx +31 -0
  168. package/src/components/ui/stepper/step.tsx +179 -0
  169. package/src/components/ui/stepper/stepper.tsx +89 -0
  170. package/src/components/ui/textarea.tsx +22 -0
  171. package/src/components/ui/toggle.tsx +71 -0
  172. package/src/components/ui/tooltip.tsx +32 -0
  173. package/src/components/ui/write/text-format-floting-toolbar.tsx +346 -0
  174. package/src/lib/edgestore.ts +9 -0
  175. package/src/lib/pinecone-client.ts +0 -0
  176. package/src/lib/utils.ts +6 -0
  177. package/src/utils/docSerialization.ts +77 -0
  178. package/src/utils/emoji-list.ts +16615 -0
  179. package/src/utils/getDOMRangeRect.ts +27 -0
  180. package/src/utils/getSelectedNode.ts +27 -0
  181. package/src/utils/getThemeSelector.ts +25 -0
  182. package/src/utils/isMobileWidth.ts +7 -0
  183. package/src/utils/joinClasses.ts +13 -0
  184. package/src/utils/setFloatingElemPosition.ts +74 -0
  185. package/src/utils/setFloatingElemPositionForLinkEditor.ts +46 -0
  186. package/src/utils/swipe.ts +127 -0
  187. package/src/utils/url.ts +38 -0
  188. package/tsconfig.json +27 -0
@@ -0,0 +1,179 @@
1
+
2
+ import type {
3
+ DOMConversionMap,
4
+ DOMConversionOutput,
5
+ DOMExportOutput,
6
+ EditorConfig,
7
+ ElementFormatType,
8
+ LexicalEditor,
9
+ LexicalNode,
10
+ NodeKey,
11
+ Spread,
12
+ } from 'lexical';
13
+
14
+ import { BlockWithAlignableContents } from '@lexical/react/LexicalBlockWithAlignableContents';
15
+ import {
16
+ DecoratorBlockNode,
17
+ SerializedDecoratorBlockNode,
18
+ } from '@lexical/react/LexicalDecoratorBlockNode';
19
+ import * as React from 'react';
20
+
21
+ type YouTubeComponentProps = Readonly<{
22
+ className: Readonly<{
23
+ base: string;
24
+ focus: string;
25
+ }>;
26
+ format: ElementFormatType | null;
27
+ nodeKey: NodeKey;
28
+ videoID: string;
29
+ }>;
30
+
31
+ function YouTubeComponent({
32
+ className,
33
+ format,
34
+ nodeKey,
35
+ videoID,
36
+ }: YouTubeComponentProps) {
37
+ return (
38
+ <BlockWithAlignableContents
39
+ className={className}
40
+ format={format}
41
+ nodeKey={nodeKey}>
42
+ <iframe
43
+ width="560"
44
+ height="315"
45
+ style={{
46
+ width: "100%",
47
+ aspectRatio: "16/9",
48
+ borderRadius: "8px",
49
+ border: "4px solid #e6c10aff"
50
+ }}
51
+ src={`https://www.youtube-nocookie.com/embed/${videoID}`}
52
+ frameBorder="0"
53
+ allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
54
+ allowFullScreen={true}
55
+ title="YouTube video"
56
+ />
57
+ </BlockWithAlignableContents>
58
+ );
59
+ }
60
+
61
+ export type SerializedYouTubeNode = Spread<
62
+ {
63
+ videoID: string;
64
+ },
65
+ SerializedDecoratorBlockNode
66
+ >;
67
+
68
+ function $convertYoutubeElement(
69
+ domNode: HTMLElement,
70
+ ): null | DOMConversionOutput {
71
+ const videoID = domNode.getAttribute('data-lexical-youtube');
72
+ if (videoID) {
73
+ const node = $createYouTubeNode(videoID);
74
+ return { node };
75
+ }
76
+ return null;
77
+ }
78
+
79
+ export class YouTubeNode extends DecoratorBlockNode {
80
+ __id: string;
81
+
82
+ static getType(): string {
83
+ return 'youtube';
84
+ }
85
+
86
+ static clone(node: YouTubeNode): YouTubeNode {
87
+ return new YouTubeNode(node.__id, node.__format, node.__key);
88
+ }
89
+
90
+ static importJSON(serializedNode: SerializedYouTubeNode): YouTubeNode {
91
+ return $createYouTubeNode(serializedNode.videoID).updateFromJSON(
92
+ serializedNode,
93
+ );
94
+ }
95
+
96
+ exportJSON(): SerializedYouTubeNode {
97
+ return {
98
+ ...super.exportJSON(),
99
+ videoID: this.__id,
100
+ };
101
+ }
102
+
103
+ constructor(id: string, format?: ElementFormatType, key?: NodeKey) {
104
+ super(format, key);
105
+ this.__id = id;
106
+ }
107
+
108
+ exportDOM(): DOMExportOutput {
109
+ const element = document.createElement('iframe');
110
+ element.setAttribute('data-lexical-youtube', this.__id);
111
+ element.setAttribute('width', '560');
112
+ element.setAttribute('height', '315');
113
+ element.setAttribute(
114
+ 'src',
115
+ `https://www.youtube-nocookie.com/embed/${this.__id}`,
116
+ );
117
+ element.setAttribute('frameborder', '0');
118
+ element.setAttribute(
119
+ 'allow',
120
+ 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture',
121
+ );
122
+ element.setAttribute('allowfullscreen', 'true');
123
+ element.setAttribute('title', 'YouTube video');
124
+ return { element };
125
+ }
126
+
127
+ static importDOM(): DOMConversionMap | null {
128
+ return {
129
+ iframe: (domNode: HTMLElement) => {
130
+ if (!domNode.hasAttribute('data-lexical-youtube')) {
131
+ return null;
132
+ }
133
+ return {
134
+ conversion: $convertYoutubeElement,
135
+ priority: 1,
136
+ };
137
+ },
138
+ };
139
+ }
140
+
141
+ updateDOM(): false {
142
+ return false;
143
+ }
144
+
145
+ getId(): string {
146
+ return this.__id;
147
+ }
148
+
149
+ getTextContent(
150
+ ): string {
151
+ return `https://www.youtube.com/watch?v=${this.__id}`;
152
+ }
153
+
154
+ decorate(_editor: LexicalEditor, config: EditorConfig): React.JSX.Element {
155
+ const embedBlockTheme = config.theme.embedBlock || {};
156
+ const className = {
157
+ base: embedBlockTheme.base || '',
158
+ focus: embedBlockTheme.focus || '',
159
+ };
160
+ return (
161
+ <YouTubeComponent
162
+ className={className}
163
+ format={this.__format}
164
+ nodeKey={this.getKey()}
165
+ videoID={this.__id}
166
+ />
167
+ );
168
+ }
169
+ }
170
+
171
+ export function $createYouTubeNode(videoID: string): YouTubeNode {
172
+ return new YouTubeNode(videoID);
173
+ }
174
+
175
+ export function $isYouTubeNode(
176
+ node: YouTubeNode | LexicalNode | null | undefined,
177
+ ): node is YouTubeNode {
178
+ return node instanceof YouTubeNode;
179
+ }
@@ -0,0 +1,41 @@
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 {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext';
10
+ import {$insertNodeToNearestRoot} from '@lexical/utils';
11
+ import {COMMAND_PRIORITY_EDITOR, createCommand, LexicalCommand} from 'lexical';
12
+ import {JSX, useEffect} from 'react';
13
+ import { $createYouTubeNode, YouTubeNode } from '../YouTubeNode';
14
+
15
+
16
+ export const INSERT_YOUTUBE_COMMAND: LexicalCommand<string> = createCommand(
17
+ 'INSERT_YOUTUBE_COMMAND',
18
+ );
19
+
20
+ export default function YouTubePlugin(): JSX.Element | null {
21
+ const [editor] = useLexicalComposerContext();
22
+
23
+ useEffect(() => {
24
+ if (!editor.hasNodes([YouTubeNode])) {
25
+ throw new Error('YouTubePlugin: YouTubeNode not registered on editor');
26
+ }
27
+
28
+ return editor.registerCommand<string>(
29
+ INSERT_YOUTUBE_COMMAND,
30
+ (payload) => {
31
+ const youTubeNode = $createYouTubeNode(payload);
32
+ $insertNodeToNearestRoot(youTubeNode);
33
+
34
+ return true;
35
+ },
36
+ COMMAND_PRIORITY_EDITOR,
37
+ );
38
+ }, [editor]);
39
+
40
+ return null;
41
+ }
@@ -0,0 +1,113 @@
1
+
2
+ import type {EditorThemeClasses} from 'lexical';
3
+
4
+
5
+
6
+ import "./theme.css"
7
+ const theme: EditorThemeClasses = {
8
+ code:`
9
+ bg-[#e1e1e1] dark:bg-[#1a1a1a] m-0 text-sm
10
+ overflow-auto relative pl-[52px] p-3 font-mono group
11
+ rounded-sm w-full h-fit block line-code
12
+ `,
13
+ codeHighlight: {
14
+ atrule: 'PlaygroundEditorTheme__tokenAttr',
15
+ attr: 'PlaygroundEditorTheme__tokenAttr',
16
+ boolean: 'PlaygroundEditorTheme__tokenProperty',
17
+ builtin: 'PlaygroundEditorTheme__tokenSelector',
18
+ cdata: 'PlaygroundEditorTheme__tokenComment',
19
+ char: 'PlaygroundEditorTheme__tokenSelector',
20
+ class: 'PlaygroundEditorTheme__tokenFunction',
21
+ 'class-name': 'PlaygroundEditorTheme__tokenFunction',
22
+ comment: 'PlaygroundEditorTheme__tokenComment',
23
+ constant: 'PlaygroundEditorTheme__tokenProperty',
24
+ deleted: 'PlaygroundEditorTheme__tokenProperty',
25
+ doctype: 'PlaygroundEditorTheme__tokenComment',
26
+ entity: 'PlaygroundEditorTheme__tokenOperator',
27
+ function: 'PlaygroundEditorTheme__tokenFunction',
28
+ important: 'PlaygroundEditorTheme__tokenVariable',
29
+ inserted: 'PlaygroundEditorTheme__tokenSelector',
30
+ keyword: 'PlaygroundEditorTheme__tokenAttr',
31
+ namespace: 'PlaygroundEditorTheme__tokenVariable',
32
+ number: 'PlaygroundEditorTheme__tokenProperty',
33
+ operator: 'PlaygroundEditorTheme__tokenOperator',
34
+ prolog: 'PlaygroundEditorTheme__tokenComment',
35
+ property: 'PlaygroundEditorTheme__tokenProperty',
36
+ punctuation: 'PlaygroundEditorTheme__tokenPunctuation',
37
+ regex: 'PlaygroundEditorTheme__tokenVariable',
38
+ selector: 'PlaygroundEditorTheme__tokenSelector',
39
+ string: 'PlaygroundEditorTheme__tokenSelector',
40
+ symbol: 'PlaygroundEditorTheme__tokenProperty',
41
+ tag: 'PlaygroundEditorTheme__tokenProperty',
42
+ url: 'PlaygroundEditorTheme__tokenOperator',
43
+ variable: 'PlaygroundEditorTheme__tokenVariable',
44
+ },
45
+ embedBlock: {
46
+ base: 'PlaygroundEditorTheme__embedBlock',
47
+ focus: 'PlaygroundEditorTheme__embedBlockFocus',
48
+ },
49
+ list: {
50
+ checklist: 'PlaygroundEditorTheme__checklist',
51
+ listitem: 'PlaygroundEditorTheme__listItem',
52
+ listitemChecked: 'PlaygroundEditorTheme__listItemChecked',
53
+ listitemUnchecked: 'PlaygroundEditorTheme__listItemUnchecked',
54
+ nested: {
55
+ listitem: 'PlaygroundEditorTheme__nestedListItem',
56
+ },
57
+ olDepth: [
58
+ 'PlaygroundEditorTheme__ol1 ',
59
+ 'PlaygroundEditorTheme__ol2',
60
+ 'PlaygroundEditorTheme__ol3',
61
+ 'PlaygroundEditorTheme__ol4',
62
+ 'PlaygroundEditorTheme__ol5',
63
+ ],
64
+ ulDepth:[
65
+ 'PlaygroundEditorTheme__ul1',
66
+ 'PlaygroundEditorTheme__ul2',
67
+ 'PlaygroundEditorTheme__ul3',
68
+ 'PlaygroundEditorTheme__ul4',
69
+ 'PlaygroundEditorTheme__ul5'
70
+ ],
71
+ ul: 'ul',
72
+ ol:"ol"
73
+ },
74
+ paragraph: 'leading-7',
75
+ link: `underline cursor-pointer text-blue-600 after:content-['_↗']`,
76
+ hr: 'w-full h-1 border-input',
77
+ table: 'PlaygroundEditorTheme__table',
78
+ tableCell: 'PlaygroundEditorTheme__tableCell',
79
+ tableCellActionButton: 'PlaygroundEditorTheme__tableCellActionButton',
80
+ tableCellActionButtonContainer:'PlaygroundEditorTheme__tableCellActionButtonContainer',
81
+ tableCellHeader: 'PlaygroundEditorTheme__tableCellHeader',
82
+ tableCellResizer: 'PlaygroundEditorTheme__tableCellResizer',
83
+ tableCellSelected: 'PlaygroundEditorTheme__tableCellSelected',
84
+ tableRowStriping: 'PlaygroundEditorTheme__tableRowStriping',
85
+ tableScrollableWrapper: 'PlaygroundEditorTheme__tableScrollableWrapper',
86
+ tableSelected: 'PlaygroundEditorTheme__tableSelected',
87
+ tableSelection: 'PlaygroundEditorTheme__tableSelection',
88
+ layoutContainer: 'grid gap-[10px] my-[10px] ',
89
+ layoutItem: 'px-2 py-[16px] border dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-50 border border-zinc-200 bg-white/90 shadow-md rounded-sm',
90
+ heading: {
91
+ h1: "scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",
92
+ h2: "scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0",
93
+ h3: "scroll-m-20 text-2xl font-semibold tracking-tight",
94
+ h4: "scroll-m-20 text-xl font-semibold tracking-tight",
95
+ h5: "text-lg font-bold",
96
+ h6: "text-sm font-bold",
97
+ },
98
+ quote:"mt-6 border-l-[4px] pl-6 italic",
99
+ text: {
100
+ bold: 'font-bold',
101
+ capitalize: 'capitalize',
102
+ code: "inline-flex items-center rounded-sm border border-zinc-200 px-0.1 py-0 h-fit min-h-[20px] transition-colors focus:outline-none focus:ring-2 focus:ring-zinc-950 focus:ring-offset-2 dark:border-zinc-800 dark:focus:ring-zinc-300 border-transparent bg-zinc-100 text-zinc-900 hover:bg-zinc-100/80 dark:bg-zinc-800 dark:text-zinc-50 dark:hover:bg-zinc-800/80",
103
+ italic: 'italic ',
104
+ lowercase: 'lowercase',
105
+ strikethrough: 'line-through',
106
+ underline: 'underline',
107
+ underlineStrikethrough: 'underline line-through',
108
+ uppercase: 'uppercase',
109
+ },
110
+
111
+ };
112
+
113
+ export default theme;
@@ -0,0 +1,377 @@
1
+ .PlaygroundEditorTheme__table {
2
+ border-collapse: collapse;
3
+ border-spacing: 0;
4
+ overflow-x: auto;
5
+ table-layout: fixed;
6
+ display: block;
7
+ max-width: fit-content;
8
+ width: 100%;
9
+ margin: 0px 25px 30px 0px;
10
+ }
11
+
12
+ .PlaygroundEditorTheme__tableSelection *::selection {
13
+ background-color: transparent;
14
+ }
15
+ .PlaygroundEditorTheme__tableSelected {
16
+ outline: 2px solid rgb(60, 132, 244);
17
+ }
18
+ .PlaygroundEditorTheme__tableCell {
19
+ border: 1px solid #979797;
20
+ width: 75px;
21
+ min-width: 75px;
22
+ vertical-align: top;
23
+ text-align: start;
24
+ padding: 6px 8px;
25
+ position: relative;
26
+ outline: none;
27
+ }
28
+ .PlaygroundEditorTheme__tableCellSortedIndicator {
29
+ display: block;
30
+ opacity: 0.5;
31
+ position: absolute;
32
+ bottom: 0;
33
+ left: 0;
34
+ width: 100%;
35
+
36
+ height: 4px;
37
+ background-color: #999;
38
+ }
39
+ .PlaygroundEditorTheme__tableCellResizer {
40
+ position: absolute;
41
+ right: -4px;
42
+ height: 100%;
43
+ width: 8px;
44
+ cursor: ew-resize;
45
+ z-index: 10;
46
+ top: 0;
47
+ }
48
+ .PlaygroundEditorTheme__tableCellHeader {
49
+ text-align: start;
50
+ }
51
+ .PlaygroundEditorTheme__tableCellSelected {
52
+ background-color: #c9dbf0;
53
+ }
54
+ .PlaygroundEditorTheme__tableCellPrimarySelected {
55
+ border: 2px solid rgb(60, 132, 244);
56
+ display: block;
57
+ height: calc(100% - 2px);
58
+ position: absolute;
59
+ width: calc(100% - 2px);
60
+ left: -1px;
61
+ top: -1px;
62
+ z-index: 2;
63
+ }
64
+ .PlaygroundEditorTheme__tableCellEditing {
65
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
66
+ border-radius: 3px;
67
+ }
68
+ .PlaygroundEditorTheme__tableAddColumns {
69
+ position: absolute;
70
+ background-color: #eee;
71
+ height: 100%;
72
+ animation: table-controls 0.2s ease;
73
+ border: 0;
74
+ cursor: pointer;
75
+ }
76
+ .PlaygroundEditorTheme__tableAddColumns:after {
77
+ background-image: url(/public/images/icons/plus.svg);
78
+ background-size: contain;
79
+ background-position: center;
80
+ background-repeat: no-repeat;
81
+ display: block;
82
+ content: " ";
83
+ position: absolute;
84
+ top: 0;
85
+ left: 0;
86
+ width: 100%;
87
+ height: 100%;
88
+ opacity: 0.4;
89
+ }
90
+ .PlaygroundEditorTheme__tableAddColumns:hover,
91
+ .PlaygroundEditorTheme__tableAddRows:hover {
92
+ background-color: #c9dbf0;
93
+ }
94
+ .PlaygroundEditorTheme__tableAddRows {
95
+ position: absolute;
96
+ width: calc(100% - 25px);
97
+ background-color: #eee;
98
+ animation: table-controls 0.2s ease;
99
+ border: 0;
100
+ cursor: pointer;
101
+ }
102
+ .PlaygroundEditorTheme__tableAddRows:after {
103
+ background-image: url(/public/images/icons/plus.svg);
104
+ background-size: contain;
105
+ background-position: center;
106
+ background-repeat: no-repeat;
107
+ display: block;
108
+ content: " ";
109
+ position: absolute;
110
+ top: 0;
111
+ left: 0;
112
+ width: 100%;
113
+ height: 100%;
114
+ opacity: 0.4;
115
+ }
116
+ @keyframes table-controls {
117
+ 0% {
118
+ opacity: 0;
119
+ }
120
+ 100% {
121
+ opacity: 1;
122
+ }
123
+ }
124
+ .PlaygroundEditorTheme__tableCellResizeRuler {
125
+ display: block;
126
+ position: absolute;
127
+ width: 1px;
128
+ background-color: rgb(60, 132, 244);
129
+ height: 100%;
130
+ top: 0;
131
+ }
132
+ .PlaygroundEditorTheme__tableCellActionButtonContainer {
133
+ display: block;
134
+ right: 5px;
135
+ top: 6px;
136
+ position: absolute;
137
+ z-index: 4;
138
+ width: 20px;
139
+ height: 20px;
140
+ }
141
+ .PlaygroundEditorTheme__tableCellActionButton {
142
+ background-color: #eee;
143
+ display: block;
144
+ border: 0;
145
+ border-radius: 20px;
146
+ width: 20px;
147
+ height: 20px;
148
+ color: #222;
149
+ cursor: pointer;
150
+ }
151
+ .PlaygroundEditorTheme__tableCellActionButton:hover {
152
+ background-color: #ddd;
153
+ }
154
+
155
+ .PlaygroundEditorTheme__tokenComment {
156
+ color: slategray;
157
+ }
158
+ .PlaygroundEditorTheme__tokenPunctuation {
159
+ color: #999;
160
+ }
161
+ .PlaygroundEditorTheme__tokenProperty {
162
+ color: rgba(226, 113, 175, 0.5);
163
+ }
164
+ .PlaygroundEditorTheme__tokenSelector {
165
+ color: #690;
166
+ }
167
+ .PlaygroundEditorTheme__tokenOperator {
168
+ color: #9a6e3a;
169
+ }
170
+ .PlaygroundEditorTheme__tokenAttr {
171
+ color: #07a;
172
+ }
173
+ .PlaygroundEditorTheme__tokenVariable {
174
+ color: #e90;
175
+ }
176
+ .PlaygroundEditorTheme__tokenFunction {
177
+ color: #e398a7;
178
+ }
179
+
180
+ .PlaygroundEditorTheme__embedBlock {
181
+ user-select: none;
182
+ }
183
+ .PlaygroundEditorTheme__embedBlockFocus {
184
+ outline: 2px solid rgb(60, 132, 244);
185
+ }
186
+
187
+ .line-code{
188
+ tab-size: 2;
189
+ }
190
+
191
+
192
+ .line-code:before {
193
+ content: attr(data-gutter);
194
+ position: absolute;
195
+ background-color:transparent;
196
+ left: 0;
197
+ top: 0;
198
+ height: 100%;
199
+ border-right: 1px solid rgba(42, 42, 42, 0.158);
200
+ padding: 8px;
201
+ color: rgba(0, 0, 0, 0.349);
202
+ white-space: pre-wrap;
203
+ text-align: right;
204
+ min-width: 25px;
205
+ }
206
+ .line-code:before:hover{
207
+ background: red;
208
+ }
209
+ .dark .line-code:before{
210
+ border-right: 1px solid #3b3b3b65;
211
+ color: #777;
212
+
213
+ }
214
+
215
+ .PlaygroundEditorTheme__ul1,
216
+ .PlaygroundEditorTheme__ul2,
217
+ .PlaygroundEditorTheme__ul3,
218
+ .PlaygroundEditorTheme__ul4,
219
+ .PlaygroundEditorTheme__ul5 {
220
+ padding: 0;
221
+ margin: 0;
222
+ list-style-position: inside;
223
+
224
+ }
225
+ .PlaygroundEditorTheme__ol1,
226
+ .PlaygroundEditorTheme__ol2,
227
+ .PlaygroundEditorTheme__ol3,
228
+ .PlaygroundEditorTheme__ol4,
229
+ .PlaygroundEditorTheme__ol5 {
230
+ padding: 0;
231
+ margin: 0;
232
+ list-style-position: inside;
233
+ }
234
+ .PlaygroundEditorTheme__listItem {
235
+ margin: 2px 32px;
236
+
237
+ }
238
+
239
+
240
+ .PlaygroundEditorTheme__listItemChecked,
241
+ .PlaygroundEditorTheme__listItemUnchecked {
242
+ position: relative;
243
+ margin-left: 8px;
244
+ margin-right: 8px;
245
+ padding-left: 24px;
246
+ padding-right: 24px;
247
+ list-style-type: none;
248
+ outline: none;
249
+ }
250
+ .ol {
251
+ list-style-type: decimal;
252
+ }
253
+
254
+ .ul {
255
+ list-style-type:disc;
256
+ }
257
+
258
+ .PlaygroundEditorTheme__listItemChecked {
259
+ text-decoration: line-through;
260
+ }
261
+ .PlaygroundEditorTheme__listItemUnchecked:before,
262
+ .PlaygroundEditorTheme__listItemChecked:before {
263
+ content: '';
264
+ width: 16px;
265
+ height: 16px;
266
+ top: 4px;
267
+ left: 0;
268
+ cursor: pointer;
269
+ display: block;
270
+ background-size: cover;
271
+ position: absolute;
272
+ }
273
+ .PlaygroundEditorTheme__listItemUnchecked[dir='rtl']:before,
274
+ .PlaygroundEditorTheme__listItemChecked[dir='rtl']:before {
275
+ left: auto;
276
+ right: 0;
277
+ }
278
+ .PlaygroundEditorTheme__listItemUnchecked:focus:before,
279
+ .PlaygroundEditorTheme__listItemChecked:focus:before {
280
+ box-shadow: 0 0 0 2px #a6cdfe;
281
+ border-radius: 2px;
282
+ }
283
+ .PlaygroundEditorTheme__listItemUnchecked:before {
284
+ border: 1px solid #999;
285
+ border-radius: 2px;
286
+ }
287
+ .PlaygroundEditorTheme__listItemChecked:before {
288
+ border: 1px solid rgb(61, 135, 245);
289
+ border-radius: 2px;
290
+ background-color: #3d87f5;
291
+ background-repeat: no-repeat;
292
+ }
293
+ .PlaygroundEditorTheme__listItemChecked:after {
294
+ content: '';
295
+ cursor: pointer;
296
+ border-color: #fff;
297
+ border-style: solid;
298
+ position: absolute;
299
+ display: block;
300
+ top: 9px;
301
+ width: 3px;
302
+ left: 7px;
303
+ right: 7px;
304
+ height: 6px;
305
+ transform: rotate(45deg);
306
+ border-width: 0 2px 2px 0;
307
+ }
308
+
309
+ .PlaygroundEditorTheme__ol1 {
310
+ padding: 0;
311
+ margin: 0;
312
+ list-style-position: outside;
313
+ }
314
+ .PlaygroundEditorTheme__ol2 {
315
+ padding: 0;
316
+ margin: 0;
317
+ list-style-type: upper-alpha;
318
+ list-style-position: outside;
319
+ }
320
+ .PlaygroundEditorTheme__ol3 {
321
+ padding: 0;
322
+ margin: 0;
323
+ list-style-type: lower-alpha;
324
+ list-style-position: outside;
325
+ }
326
+ .PlaygroundEditorTheme__ol4 {
327
+ padding: 0;
328
+ margin: 0;
329
+ list-style-type: upper-roman;
330
+ list-style-position: outside;
331
+ }
332
+ .PlaygroundEditorTheme__ol5 {
333
+ padding: 0;
334
+ margin: 0;
335
+ list-style-type: lower-roman;
336
+ list-style-position: outside;
337
+ }
338
+
339
+ .PlaygroundEditorTheme__ul1 {
340
+ padding: 0;
341
+ margin: 0;
342
+ list-style-type:disc;
343
+ list-style-position: outside;
344
+ }
345
+ .PlaygroundEditorTheme__ul2 {
346
+ padding: 0;
347
+ margin: 0;
348
+ list-style-type:circle;
349
+ list-style-position: outside;
350
+ }
351
+ .PlaygroundEditorTheme__ul3 {
352
+ padding: 0;
353
+ margin: 0;
354
+ list-style-type:square;
355
+ list-style-position: outside;
356
+ }
357
+ .PlaygroundEditorTheme__ul4 {
358
+ padding: 0;
359
+ margin: 0;
360
+ list-style-type:circle;
361
+ list-style-position: outside;
362
+ }
363
+ .PlaygroundEditorTheme__ul5 {
364
+ padding: 0;
365
+ margin: 0;
366
+ list-style-type:disc;
367
+ list-style-position: outside;
368
+ }
369
+
370
+
371
+ .PlaygroundEditorTheme__nestedListItem {
372
+ list-style-type: none;
373
+ }
374
+ .PlaygroundEditorTheme__nestedListItem:before,
375
+ .PlaygroundEditorTheme__nestedListItem:after {
376
+ display: none;
377
+ }