@gcforms/editor 0.0.1 → 1.0.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 +15 -0
- package/package.json +5 -5
- package/src/Editor.tsx +93 -74
- package/src/config.ts +6 -3
- package/src/context/LocaleContext.tsx +31 -0
- package/src/context/ToolbarContext.tsx +86 -0
- package/src/hooks/useTranslation.tsx +19 -0
- package/src/i18n/en.json +22 -0
- package/src/i18n/fr.json +22 -0
- package/src/i18n/index.tsx +12 -0
- package/src/icons/CancelIcon.tsx +15 -0
- package/src/icons/CheckIcon.tsx +15 -0
- package/src/icons/DeleteIcon.tsx +15 -0
- package/src/icons/EditIcon.tsx +4 -3
- package/src/icons/LinkIcon.tsx +2 -2
- package/src/plugins/FloatingLinkEditorPlugin/index.css +50 -54
- package/src/plugins/FloatingLinkEditorPlugin/index.tsx +305 -138
- package/src/plugins/MaxLengthPlugin/index.tsx +56 -0
- package/src/plugins/ShortcutsPlugin/index.tsx +78 -0
- package/src/plugins/ShortcutsPlugin/shortcuts.ts +76 -0
- package/src/plugins/ToolbarPlugin/index.tsx +121 -149
- package/src/plugins/ToolbarPlugin/styles.css +4 -6
- package/src/plugins/ToolbarPlugin/utils.ts +172 -0
- package/src/styles.css +8 -8
- package/src/tests/Editor.cy.tsx +5 -3
- package/src/transformers/index.ts +18 -0
- package/src/ui/ContentEditable.css +2 -16
- package/src/ui/ContentEditable.tsx +2 -2
- package/src/ui/ToolTip.css +35 -0
- package/src/{ToolTip.tsx → ui/ToolTip.tsx} +4 -6
- package/src/utils/url.ts +7 -9
- package/src/themes/BasicTheme.ts +0 -69
|
@@ -1,71 +1,67 @@
|
|
|
1
|
-
/*********************
|
|
2
|
-
* link editor *
|
|
3
|
-
*********************/
|
|
4
1
|
.gc-link-editor {
|
|
2
|
+
display: flex;
|
|
5
3
|
position: absolute;
|
|
6
4
|
top: 0;
|
|
7
5
|
left: 0;
|
|
8
|
-
z-index:
|
|
6
|
+
z-index: 100;
|
|
9
7
|
max-width: 400px;
|
|
10
8
|
width: 100%;
|
|
9
|
+
opacity: 0;
|
|
11
10
|
background-color: #fff;
|
|
12
|
-
border:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
.gc-link-editor button.active,
|
|
17
|
-
.toolbar button.active {
|
|
18
|
-
background-color: #fff;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.gc-link-editor .link-input {
|
|
22
|
-
display: inline-block;
|
|
23
|
-
width: calc(100% - 24px);
|
|
24
|
-
box-sizing: border-box;
|
|
25
|
-
margin: 8px 12px;
|
|
26
|
-
padding: 8px 12px;
|
|
27
|
-
border-radius: 8px;
|
|
28
|
-
background-color: #eee;
|
|
29
|
-
font-size: 15px;
|
|
30
|
-
color: #050505;
|
|
31
|
-
border: 0;
|
|
32
|
-
outline: 0;
|
|
33
|
-
position: relative;
|
|
34
|
-
font-family: inherit;
|
|
11
|
+
border-radius: 4px;
|
|
12
|
+
transition: opacity 0.5s;
|
|
13
|
+
will-change: transform;
|
|
35
14
|
}
|
|
36
15
|
|
|
37
|
-
.gc-link-editor
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
16
|
+
.gc-link-editor-container {
|
|
17
|
+
border: 1px solid #1e293b;
|
|
18
|
+
border-radius: 6px;
|
|
19
|
+
width: 100%;
|
|
20
|
+
padding: 8px;
|
|
21
|
+
gap: 4px;
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: space-between;
|
|
24
|
+
input {
|
|
25
|
+
font-size: 0.9rem;
|
|
26
|
+
padding: 2px 6px;
|
|
27
|
+
width: 100%;
|
|
28
|
+
}
|
|
29
|
+
.link {
|
|
30
|
+
padding: 2px 4px;
|
|
31
|
+
font-size: 0.9rem;
|
|
32
|
+
width: 100%;
|
|
33
|
+
text-align: left;
|
|
34
|
+
}
|
|
48
35
|
}
|
|
49
36
|
|
|
50
|
-
.gc-link-editor
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
overflow: hidden;
|
|
56
|
-
margin-right: 30px;
|
|
57
|
-
text-overflow: ellipsis;
|
|
37
|
+
.gc-link-editor-button-disabled {
|
|
38
|
+
cursor: not-allowed;
|
|
39
|
+
svg {
|
|
40
|
+
fill: #ccc !important;
|
|
41
|
+
}
|
|
58
42
|
}
|
|
59
43
|
|
|
60
|
-
.gc-link-editor
|
|
61
|
-
.gc-link-editor .font-family-wrapper {
|
|
44
|
+
.gc-link-editor-actions {
|
|
62
45
|
display: flex;
|
|
63
|
-
|
|
46
|
+
gap: 4px;
|
|
47
|
+
background-color: #fff;
|
|
48
|
+
border-radius: 8px;
|
|
49
|
+
padding: 6px 12px;
|
|
50
|
+
svg {
|
|
51
|
+
fill: #1e293b;
|
|
52
|
+
width: 20px;
|
|
53
|
+
height: 20px;
|
|
54
|
+
}
|
|
64
55
|
}
|
|
65
56
|
|
|
66
|
-
.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
.sr-only {
|
|
58
|
+
position: absolute;
|
|
59
|
+
width: 1px;
|
|
60
|
+
height: 1px;
|
|
61
|
+
padding: 0;
|
|
62
|
+
margin: -1px;
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
clip: rect(0, 0, 0, 0);
|
|
65
|
+
white-space: nowrap;
|
|
66
|
+
border-width: 0;
|
|
71
67
|
}
|