@ceedcv-maya/shared-editor-react 0.10.0 → 0.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.
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Read-only content typography for rendered TipTap/ProseMirror HTML.
3
+ *
4
+ * The live editor styles its content via `.maya-editor-wrapper .ProseMirror …`
5
+ * (see maya-editor.css), which only matches inside the editor view. Read-only
6
+ * previews (`EditorContentHtml` / `EditorContentJson`) render a plain
7
+ * `.maya-editor-content` container with no `.ProseMirror`, so without these
8
+ * rules headings, lists, quotes, code and tables collapse to base size —
9
+ * especially under Tailwind Preflight, which resets `h1`–`h6` to inherit.
10
+ *
11
+ * These rules mirror the editor's scale but are scoped to `.maya-editor-content`
12
+ * (specificity 0,1,1) — strictly lower than the editor's `.maya-editor-wrapper
13
+ * .ProseMirror h1` (0,2,1) — so the live editor's appearance is unchanged while
14
+ * every read-only consumer gets matching typography.
15
+ */
16
+
17
+ .maya-editor-content {
18
+ font-size: 15px;
19
+ line-height: 1.6;
20
+ }
21
+
22
+ .maya-editor-content p { margin: 0.5em 0; }
23
+ .maya-editor-content p:first-child { margin-top: 0; }
24
+ .maya-editor-content p:last-child { margin-bottom: 0; }
25
+ .maya-editor-content > :first-child { margin-top: 0; }
26
+ .maya-editor-content > :last-child { margin-bottom: 0; }
27
+
28
+ .maya-editor-content h1 { font-size: 1.7em; font-weight: 700; margin: 0.8em 0 0.3em; line-height: 1.25; }
29
+ .maya-editor-content h2 { font-size: 1.4em; font-weight: 700; margin: 0.8em 0 0.3em; line-height: 1.3; }
30
+ .maya-editor-content h3 { font-size: 1.2em; font-weight: 600; margin: 0.7em 0 0.25em; }
31
+ .maya-editor-content h4 { font-size: 1.05em; font-weight: 600; margin: 0.6em 0 0.2em; }
32
+ .maya-editor-content h5 { font-size: 1em; font-weight: 600; margin: 0.6em 0 0.2em; }
33
+ .maya-editor-content h6 { font-size: 0.9em; font-weight: 600; margin: 0.6em 0 0.2em; text-transform: uppercase; letter-spacing: 0.03em; }
34
+
35
+ .maya-editor-content ul,
36
+ .maya-editor-content ol {
37
+ padding-left: 1.4em;
38
+ margin: 0.5em 0;
39
+ }
40
+ .maya-editor-content ul { list-style: disc; }
41
+ .maya-editor-content ol { list-style: decimal; }
42
+ .maya-editor-content li { margin: 0.2em 0; }
43
+ .maya-editor-content li > p { margin: 0; }
44
+
45
+ /* Task lists (taskList / taskItem) */
46
+ .maya-editor-content ul[data-type="taskList"] {
47
+ list-style: none;
48
+ padding-left: 0.25em;
49
+ }
50
+ .maya-editor-content li[data-type="taskItem"] {
51
+ display: flex;
52
+ gap: 6px;
53
+ align-items: flex-start;
54
+ list-style: none;
55
+ }
56
+ .maya-editor-content li[data-type="taskItem"] > label { flex-shrink: 0; margin-top: 0.2em; }
57
+ .maya-editor-content li[data-type="taskItem"] > div { flex: 1; }
58
+
59
+ /* Indent attribute (Indent extension) */
60
+ .maya-editor-content [data-indent="1"] { margin-left: 2em; }
61
+ .maya-editor-content [data-indent="2"] { margin-left: 4em; }
62
+ .maya-editor-content [data-indent="3"] { margin-left: 6em; }
63
+ .maya-editor-content [data-indent="4"] { margin-left: 8em; }
64
+ .maya-editor-content [data-indent="5"] { margin-left: 10em; }
65
+ .maya-editor-content [data-indent="6"] { margin-left: 12em; }
66
+ .maya-editor-content [data-indent="7"] { margin-left: 14em; }
67
+ .maya-editor-content [data-indent="8"] { margin-left: 16em; }
68
+
69
+ .maya-editor-content blockquote {
70
+ border-left: 3px solid var(--maya-editor-border, #d6d6df);
71
+ margin: 0.75em 0;
72
+ padding-left: 1em;
73
+ color: rgba(120, 120, 130, 0.95);
74
+ }
75
+
76
+ .maya-editor-content code {
77
+ background: rgba(127, 127, 140, 0.18);
78
+ border-radius: 3px;
79
+ padding: 0.05em 0.4em;
80
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
81
+ font-size: 0.92em;
82
+ }
83
+
84
+ .maya-editor-content pre {
85
+ background: rgba(127, 127, 140, 0.12);
86
+ border-radius: 6px;
87
+ padding: 0.8em 1em;
88
+ margin: 0.75em 0;
89
+ overflow-x: auto;
90
+ }
91
+ .maya-editor-content pre code {
92
+ background: transparent;
93
+ padding: 0;
94
+ font-size: 0.9em;
95
+ }
96
+
97
+ .maya-editor-content hr {
98
+ border: 0;
99
+ border-top: 1px solid var(--maya-editor-border, #d6d6df);
100
+ margin: 1.2em 0;
101
+ }
102
+
103
+ .maya-editor-content a {
104
+ color: var(--maya-editor-link, #7c3aed);
105
+ text-decoration: underline;
106
+ text-underline-offset: 2px;
107
+ }
108
+
109
+ .maya-editor-content table {
110
+ border-collapse: collapse;
111
+ margin: 0.8em 0;
112
+ width: 100%;
113
+ }
114
+ .maya-editor-content table th,
115
+ .maya-editor-content table td {
116
+ border: 1px solid var(--maya-editor-border, #d6d6df);
117
+ padding: 0.5em 0.7em;
118
+ vertical-align: top;
119
+ }
120
+ .maya-editor-content table th {
121
+ background: rgba(127, 127, 140, 0.08);
122
+ text-align: left;
123
+ font-weight: 600;
124
+ }
125
+
126
+ .maya-editor-content img {
127
+ max-width: 100%;
128
+ height: auto;
129
+ border-radius: 4px;
130
+ }
131
+
132
+ .maya-editor-content aside.alert {
133
+ border-left: 4px solid var(--maya-editor-link, #7c3aed);
134
+ border-radius: 4px;
135
+ background: rgba(124, 58, 237, 0.06);
136
+ padding: 0.75em 1em;
137
+ margin: 0.75em 0;
138
+ }
139
+ .maya-editor-content aside.alert-warning { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
140
+ .maya-editor-content aside.alert-success { border-left-color: #10b981; background: rgba(16, 185, 129, 0.08); }
141
+ .maya-editor-content aside.alert-danger { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.08); }
142
+
143
+ .maya-editor-content iframe {
144
+ display: block;
145
+ max-width: 100%;
146
+ margin: 0.5em 0;
147
+ border: 1px solid var(--maya-editor-border, #d6d6df);
148
+ border-radius: 6px;
149
+ }
150
+
151
+ /* Page break (PDF/export semantics) — show a subtle separator in previews. */
152
+ .maya-editor-content .page-break,
153
+ .maya-editor-content [data-page-break],
154
+ .maya-editor-content hr[data-type="pageBreak"] {
155
+ border: 0;
156
+ border-top: 2px dashed var(--maya-editor-border, #c9c9d2);
157
+ margin: 1.5em 0;
158
+ page-break-after: always;
159
+ break-after: page;
160
+ }
@@ -86,6 +86,46 @@
86
86
  /* Hidden file inputs reused by the toolbar (image, .docx) */
87
87
  .maya-editor-hidden-input { display: none; }
88
88
 
89
+ /* ── Word-style ribbon (full mode) ─────────────────────────── */
90
+ .maya-editor-ribbon {
91
+ gap: 0;
92
+ align-items: stretch;
93
+ padding: 4px 6px;
94
+ }
95
+ .maya-editor-ribbon-group {
96
+ display: flex;
97
+ flex-direction: column;
98
+ align-items: center;
99
+ gap: 3px;
100
+ padding: 2px 8px;
101
+ border-right: 1px solid var(--maya-editor-border, #e3e3e8);
102
+ }
103
+ .maya-editor-ribbon-group:last-child {
104
+ border-right: 0;
105
+ }
106
+ .maya-editor-ribbon-group__row {
107
+ display: flex;
108
+ align-items: center;
109
+ flex-wrap: wrap;
110
+ justify-content: center;
111
+ gap: 2px;
112
+ flex: 1 1 auto;
113
+ }
114
+ .maya-editor-ribbon-group__label {
115
+ font-size: 10px;
116
+ line-height: 1;
117
+ color: var(--maya-editor-muted, #8a8a94);
118
+ white-space: nowrap;
119
+ user-select: none;
120
+ }
121
+
122
+ /* Crisp icons regardless of theme. */
123
+ .maya-editor-toolbar__btn svg {
124
+ display: block;
125
+ width: 16px;
126
+ height: 16px;
127
+ }
128
+
89
129
  /* ── Comment hover popover ─────────────────────────────────── */
90
130
  .maya-comment-popover {
91
131
  position: fixed;
package/src/i18n/en.json DELETED
@@ -1,54 +0,0 @@
1
- {
2
- "editor": {
3
- "toolbar": {
4
- "bold": "Bold",
5
- "italic": "Italic",
6
- "underline": "Underline",
7
- "strike": "Strikethrough",
8
- "code": "Code",
9
- "link": "Insert link",
10
- "linkPrompt": "Link URL",
11
- "unlink": "Remove link",
12
- "heading1": "Heading 1",
13
- "heading2": "Heading 2",
14
- "heading3": "Heading 3",
15
- "paragraph": "Paragraph",
16
- "bulletList": "Bullet list",
17
- "orderedList": "Numbered list",
18
- "taskList": "Task list",
19
- "blockquote": "Quote",
20
- "codeBlock": "Code block",
21
- "horizontalRule": "Horizontal rule",
22
- "image": "Insert image",
23
- "table": "Insert table",
24
- "alert": "Alert",
25
- "iframe": "Insert iframe",
26
- "iframePrompt": "Iframe URL",
27
- "fullscreen": "Fullscreen",
28
- "exitFullscreen": "Exit fullscreen",
29
- "addComment": "Comment selection",
30
- "importDocx": "Import .docx",
31
- "exportDocx": "Export as .docx",
32
- "insertHtml": "Insert HTML",
33
- "insertMarkdown": "Insert Markdown",
34
- "undo": "Undo",
35
- "redo": "Redo",
36
- "uploadImage": "Insert image",
37
- "find": "Find and replace",
38
- "findPlaceholder": "Find",
39
- "replacePlaceholder": "Replace with",
40
- "findNext": "Next match",
41
- "findPrev": "Previous match",
42
- "replace": "Replace",
43
- "replaceAll": "Replace all",
44
- "findClose": "Close find",
45
- "caseSensitive": "Match case",
46
- "findNone": "No matches"
47
- },
48
- "placeholder": "Start typing or press / for commands…",
49
- "errors": {
50
- "uploadFailed": "File upload failed",
51
- "linkInvalid": "Invalid URL"
52
- }
53
- }
54
- }
package/src/i18n/es.json DELETED
@@ -1,54 +0,0 @@
1
- {
2
- "editor": {
3
- "toolbar": {
4
- "bold": "Negrita",
5
- "italic": "Cursiva",
6
- "underline": "Subrayado",
7
- "strike": "Tachado",
8
- "code": "Código",
9
- "link": "Insertar enlace",
10
- "linkPrompt": "URL del enlace",
11
- "unlink": "Quitar enlace",
12
- "heading1": "Título 1",
13
- "heading2": "Título 2",
14
- "heading3": "Título 3",
15
- "paragraph": "Párrafo",
16
- "bulletList": "Lista",
17
- "orderedList": "Lista numerada",
18
- "taskList": "Lista de tareas",
19
- "blockquote": "Cita",
20
- "codeBlock": "Bloque de código",
21
- "horizontalRule": "Separador",
22
- "image": "Insertar imagen",
23
- "table": "Insertar tabla",
24
- "alert": "Aviso",
25
- "iframe": "Insertar iframe",
26
- "iframePrompt": "URL del iframe",
27
- "fullscreen": "Pantalla completa",
28
- "exitFullscreen": "Salir de pantalla completa",
29
- "addComment": "Comentar selección",
30
- "importDocx": "Importar .docx",
31
- "exportDocx": "Exportar como .docx",
32
- "insertHtml": "Insertar HTML",
33
- "insertMarkdown": "Insertar Markdown",
34
- "undo": "Deshacer",
35
- "redo": "Rehacer",
36
- "uploadImage": "Insertar imagen",
37
- "find": "Buscar y reemplazar",
38
- "findPlaceholder": "Buscar",
39
- "replacePlaceholder": "Reemplazar por",
40
- "findNext": "Siguiente",
41
- "findPrev": "Anterior",
42
- "replace": "Reemplazar",
43
- "replaceAll": "Reemplazar todo",
44
- "findClose": "Cerrar",
45
- "caseSensitive": "Distinguir mayúsculas",
46
- "findNone": "Sin coincidencias"
47
- },
48
- "placeholder": "Empieza a escribir o pulsa / para comandos…",
49
- "errors": {
50
- "uploadFailed": "No se pudo subir el archivo",
51
- "linkInvalid": "URL no válida"
52
- }
53
- }
54
- }