@yurikilian/lex4 0.2.0 → 0.2.2
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/dist/components/HeaderFooterActions.d.ts.map +1 -1
- package/dist/components/HeaderFooterToggle.d.ts.map +1 -1
- package/dist/components/PageBody.d.ts.map +1 -1
- package/dist/components/PageFooter.d.ts.map +1 -1
- package/dist/components/PageHeader.d.ts.map +1 -1
- package/dist/components/Toolbar.d.ts.map +1 -1
- package/dist/i18n/defaults.d.ts.map +1 -1
- package/dist/i18n/index.d.ts +1 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/pt-BR.d.ts +3 -0
- package/dist/i18n/pt-BR.d.ts.map +1 -0
- package/dist/i18n/types.d.ts +6 -0
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/lex4-editor.cjs +471 -283
- package/dist/lex4-editor.cjs.map +1 -1
- package/dist/lex4-editor.js +471 -283
- package/dist/lex4-editor.js.map +1 -1
- package/dist/lexical/plugins/font-plugin.d.ts +1 -1
- package/dist/style.css +49 -23
- package/dist/variables/variable-node.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/lex4-editor.js
CHANGED
|
@@ -1134,20 +1134,33 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
1134
1134
|
* This source code is licensed under the ISC license.
|
|
1135
1135
|
* See the LICENSE file in the root directory of this source tree.
|
|
1136
1136
|
*/
|
|
1137
|
-
const __iconNode$
|
|
1137
|
+
const __iconNode$q = [
|
|
1138
|
+
["path", { d: "m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16", key: "xik6mr" }],
|
|
1139
|
+
["path", { d: "M15.697 14h5.606", key: "1stdlc" }],
|
|
1140
|
+
["path", { d: "m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16", key: "d5nyq2" }],
|
|
1141
|
+
["path", { d: "M3.304 13h6.392", key: "1q3zxz" }]
|
|
1142
|
+
];
|
|
1143
|
+
const ALargeSmall = createLucideIcon("a-large-small", __iconNode$q);
|
|
1144
|
+
/**
|
|
1145
|
+
* @license lucide-react v1.8.0 - ISC
|
|
1146
|
+
*
|
|
1147
|
+
* This source code is licensed under the ISC license.
|
|
1148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1149
|
+
*/
|
|
1150
|
+
const __iconNode$p = [
|
|
1138
1151
|
[
|
|
1139
1152
|
"path",
|
|
1140
1153
|
{ d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8", key: "mg9rjx" }
|
|
1141
1154
|
]
|
|
1142
1155
|
];
|
|
1143
|
-
const Bold = createLucideIcon("bold", __iconNode$
|
|
1156
|
+
const Bold = createLucideIcon("bold", __iconNode$p);
|
|
1144
1157
|
/**
|
|
1145
1158
|
* @license lucide-react v1.8.0 - ISC
|
|
1146
1159
|
*
|
|
1147
1160
|
* This source code is licensed under the ISC license.
|
|
1148
1161
|
* See the LICENSE file in the root directory of this source tree.
|
|
1149
1162
|
*/
|
|
1150
|
-
const __iconNode$
|
|
1163
|
+
const __iconNode$o = [
|
|
1151
1164
|
[
|
|
1152
1165
|
"path",
|
|
1153
1166
|
{ d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
|
|
@@ -1160,27 +1173,35 @@ const __iconNode$l = [
|
|
|
1160
1173
|
}
|
|
1161
1174
|
]
|
|
1162
1175
|
];
|
|
1163
|
-
const Braces = createLucideIcon("braces", __iconNode$
|
|
1176
|
+
const Braces = createLucideIcon("braces", __iconNode$o);
|
|
1164
1177
|
/**
|
|
1165
1178
|
* @license lucide-react v1.8.0 - ISC
|
|
1166
1179
|
*
|
|
1167
1180
|
* This source code is licensed under the ISC license.
|
|
1168
1181
|
* See the LICENSE file in the root directory of this source tree.
|
|
1169
1182
|
*/
|
|
1170
|
-
const __iconNode$
|
|
1183
|
+
const __iconNode$n = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
1184
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$n);
|
|
1185
|
+
/**
|
|
1186
|
+
* @license lucide-react v1.8.0 - ISC
|
|
1187
|
+
*
|
|
1188
|
+
* This source code is licensed under the ISC license.
|
|
1189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1190
|
+
*/
|
|
1191
|
+
const __iconNode$m = [
|
|
1171
1192
|
["line", { x1: "15", x2: "15", y1: "12", y2: "18", key: "1p7wdc" }],
|
|
1172
1193
|
["line", { x1: "12", x2: "18", y1: "15", y2: "15", key: "1nscbv" }],
|
|
1173
1194
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
1174
1195
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
1175
1196
|
];
|
|
1176
|
-
const CopyPlus = createLucideIcon("copy-plus", __iconNode$
|
|
1197
|
+
const CopyPlus = createLucideIcon("copy-plus", __iconNode$m);
|
|
1177
1198
|
/**
|
|
1178
1199
|
* @license lucide-react v1.8.0 - ISC
|
|
1179
1200
|
*
|
|
1180
1201
|
* This source code is licensed under the ISC license.
|
|
1181
1202
|
* See the LICENSE file in the root directory of this source tree.
|
|
1182
1203
|
*/
|
|
1183
|
-
const __iconNode$
|
|
1204
|
+
const __iconNode$l = [
|
|
1184
1205
|
[
|
|
1185
1206
|
"path",
|
|
1186
1207
|
{
|
|
@@ -1190,65 +1211,52 @@ const __iconNode$j = [
|
|
|
1190
1211
|
],
|
|
1191
1212
|
["path", { d: "m5.082 11.09 8.828 8.828", key: "1wx5vj" }]
|
|
1192
1213
|
];
|
|
1193
|
-
const Eraser = createLucideIcon("eraser", __iconNode$
|
|
1214
|
+
const Eraser = createLucideIcon("eraser", __iconNode$l);
|
|
1194
1215
|
/**
|
|
1195
1216
|
* @license lucide-react v1.8.0 - ISC
|
|
1196
1217
|
*
|
|
1197
1218
|
* This source code is licensed under the ISC license.
|
|
1198
1219
|
* See the LICENSE file in the root directory of this source tree.
|
|
1199
1220
|
*/
|
|
1200
|
-
const __iconNode$
|
|
1201
|
-
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
1202
|
-
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
1203
|
-
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
1204
|
-
["line", { x1: "16", x2: "14", y1: "3", y2: "21", key: "weycgp" }]
|
|
1205
|
-
];
|
|
1206
|
-
const Hash = createLucideIcon("hash", __iconNode$i);
|
|
1207
|
-
/**
|
|
1208
|
-
* @license lucide-react v1.8.0 - ISC
|
|
1209
|
-
*
|
|
1210
|
-
* This source code is licensed under the ISC license.
|
|
1211
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
1212
|
-
*/
|
|
1213
|
-
const __iconNode$h = [
|
|
1221
|
+
const __iconNode$k = [
|
|
1214
1222
|
["line", { x1: "19", x2: "10", y1: "4", y2: "4", key: "15jd3p" }],
|
|
1215
1223
|
["line", { x1: "14", x2: "5", y1: "20", y2: "20", key: "bu0au3" }],
|
|
1216
1224
|
["line", { x1: "15", x2: "9", y1: "4", y2: "20", key: "uljnxc" }]
|
|
1217
1225
|
];
|
|
1218
|
-
const Italic = createLucideIcon("italic", __iconNode$
|
|
1226
|
+
const Italic = createLucideIcon("italic", __iconNode$k);
|
|
1219
1227
|
/**
|
|
1220
1228
|
* @license lucide-react v1.8.0 - ISC
|
|
1221
1229
|
*
|
|
1222
1230
|
* This source code is licensed under the ISC license.
|
|
1223
1231
|
* See the LICENSE file in the root directory of this source tree.
|
|
1224
1232
|
*/
|
|
1225
|
-
const __iconNode$
|
|
1233
|
+
const __iconNode$j = [
|
|
1226
1234
|
["path", { d: "M21 5H11", key: "us1j55" }],
|
|
1227
1235
|
["path", { d: "M21 12H11", key: "wd7e0v" }],
|
|
1228
1236
|
["path", { d: "M21 19H11", key: "saa85w" }],
|
|
1229
1237
|
["path", { d: "m7 8-4 4 4 4", key: "o5hrat" }]
|
|
1230
1238
|
];
|
|
1231
|
-
const ListIndentDecrease = createLucideIcon("list-indent-decrease", __iconNode$
|
|
1239
|
+
const ListIndentDecrease = createLucideIcon("list-indent-decrease", __iconNode$j);
|
|
1232
1240
|
/**
|
|
1233
1241
|
* @license lucide-react v1.8.0 - ISC
|
|
1234
1242
|
*
|
|
1235
1243
|
* This source code is licensed under the ISC license.
|
|
1236
1244
|
* See the LICENSE file in the root directory of this source tree.
|
|
1237
1245
|
*/
|
|
1238
|
-
const __iconNode$
|
|
1246
|
+
const __iconNode$i = [
|
|
1239
1247
|
["path", { d: "M21 5H11", key: "us1j55" }],
|
|
1240
1248
|
["path", { d: "M21 12H11", key: "wd7e0v" }],
|
|
1241
1249
|
["path", { d: "M21 19H11", key: "saa85w" }],
|
|
1242
1250
|
["path", { d: "m3 8 4 4-4 4", key: "1a3j6y" }]
|
|
1243
1251
|
];
|
|
1244
|
-
const ListIndentIncrease = createLucideIcon("list-indent-increase", __iconNode$
|
|
1252
|
+
const ListIndentIncrease = createLucideIcon("list-indent-increase", __iconNode$i);
|
|
1245
1253
|
/**
|
|
1246
1254
|
* @license lucide-react v1.8.0 - ISC
|
|
1247
1255
|
*
|
|
1248
1256
|
* This source code is licensed under the ISC license.
|
|
1249
1257
|
* See the LICENSE file in the root directory of this source tree.
|
|
1250
1258
|
*/
|
|
1251
|
-
const __iconNode$
|
|
1259
|
+
const __iconNode$h = [
|
|
1252
1260
|
["path", { d: "M11 5h10", key: "1cz7ny" }],
|
|
1253
1261
|
["path", { d: "M11 12h10", key: "1438ji" }],
|
|
1254
1262
|
["path", { d: "M11 19h10", key: "11t30w" }],
|
|
@@ -1256,14 +1264,14 @@ const __iconNode$e = [
|
|
|
1256
1264
|
["path", { d: "M4 9h2", key: "r1h2o0" }],
|
|
1257
1265
|
["path", { d: "M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02", key: "xtkcd5" }]
|
|
1258
1266
|
];
|
|
1259
|
-
const ListOrdered = createLucideIcon("list-ordered", __iconNode$
|
|
1267
|
+
const ListOrdered = createLucideIcon("list-ordered", __iconNode$h);
|
|
1260
1268
|
/**
|
|
1261
1269
|
* @license lucide-react v1.8.0 - ISC
|
|
1262
1270
|
*
|
|
1263
1271
|
* This source code is licensed under the ISC license.
|
|
1264
1272
|
* See the LICENSE file in the root directory of this source tree.
|
|
1265
1273
|
*/
|
|
1266
|
-
const __iconNode$
|
|
1274
|
+
const __iconNode$g = [
|
|
1267
1275
|
["path", { d: "M3 5h.01", key: "18ugdj" }],
|
|
1268
1276
|
["path", { d: "M3 12h.01", key: "nlz23k" }],
|
|
1269
1277
|
["path", { d: "M3 19h.01", key: "noohij" }],
|
|
@@ -1271,127 +1279,168 @@ const __iconNode$d = [
|
|
|
1271
1279
|
["path", { d: "M8 12h13", key: "1za7za" }],
|
|
1272
1280
|
["path", { d: "M8 19h13", key: "m83p4d" }]
|
|
1273
1281
|
];
|
|
1274
|
-
const List = createLucideIcon("list", __iconNode$
|
|
1282
|
+
const List = createLucideIcon("list", __iconNode$g);
|
|
1275
1283
|
/**
|
|
1276
1284
|
* @license lucide-react v1.8.0 - ISC
|
|
1277
1285
|
*
|
|
1278
1286
|
* This source code is licensed under the ISC license.
|
|
1279
1287
|
* See the LICENSE file in the root directory of this source tree.
|
|
1280
1288
|
*/
|
|
1281
|
-
const __iconNode$
|
|
1289
|
+
const __iconNode$f = [
|
|
1282
1290
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
1283
1291
|
["path", { d: "M15 3v18", key: "14nvp0" }]
|
|
1284
1292
|
];
|
|
1285
|
-
const PanelRight = createLucideIcon("panel-right", __iconNode$
|
|
1293
|
+
const PanelRight = createLucideIcon("panel-right", __iconNode$f);
|
|
1286
1294
|
/**
|
|
1287
1295
|
* @license lucide-react v1.8.0 - ISC
|
|
1288
1296
|
*
|
|
1289
1297
|
* This source code is licensed under the ISC license.
|
|
1290
1298
|
* See the LICENSE file in the root directory of this source tree.
|
|
1291
1299
|
*/
|
|
1292
|
-
const __iconNode$
|
|
1300
|
+
const __iconNode$e = [
|
|
1293
1301
|
["path", { d: "m15 14 5-5-5-5", key: "12vg1m" }],
|
|
1294
1302
|
["path", { d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13", key: "6uklza" }]
|
|
1295
1303
|
];
|
|
1296
|
-
const Redo2 = createLucideIcon("redo-2", __iconNode$
|
|
1304
|
+
const Redo2 = createLucideIcon("redo-2", __iconNode$e);
|
|
1297
1305
|
/**
|
|
1298
1306
|
* @license lucide-react v1.8.0 - ISC
|
|
1299
1307
|
*
|
|
1300
1308
|
* This source code is licensed under the ISC license.
|
|
1301
1309
|
* See the LICENSE file in the root directory of this source tree.
|
|
1302
1310
|
*/
|
|
1303
|
-
const __iconNode$
|
|
1311
|
+
const __iconNode$d = [
|
|
1304
1312
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
1305
1313
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
1306
1314
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
1307
1315
|
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
1308
1316
|
];
|
|
1309
|
-
const RefreshCw = createLucideIcon("refresh-cw", __iconNode$
|
|
1317
|
+
const RefreshCw = createLucideIcon("refresh-cw", __iconNode$d);
|
|
1310
1318
|
/**
|
|
1311
1319
|
* @license lucide-react v1.8.0 - ISC
|
|
1312
1320
|
*
|
|
1313
1321
|
* This source code is licensed under the ISC license.
|
|
1314
1322
|
* See the LICENSE file in the root directory of this source tree.
|
|
1315
1323
|
*/
|
|
1316
|
-
const __iconNode$
|
|
1324
|
+
const __iconNode$c = [
|
|
1325
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
1326
|
+
["path", { d: "M21 9H3", key: "1338ky" }],
|
|
1327
|
+
["path", { d: "M21 15H3", key: "9uk58r" }]
|
|
1328
|
+
];
|
|
1329
|
+
const Rows3 = createLucideIcon("rows-3", __iconNode$c);
|
|
1330
|
+
/**
|
|
1331
|
+
* @license lucide-react v1.8.0 - ISC
|
|
1332
|
+
*
|
|
1333
|
+
* This source code is licensed under the ISC license.
|
|
1334
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1335
|
+
*/
|
|
1336
|
+
const __iconNode$b = [
|
|
1317
1337
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
1318
1338
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
1319
1339
|
];
|
|
1320
|
-
const Search = createLucideIcon("search", __iconNode$
|
|
1340
|
+
const Search = createLucideIcon("search", __iconNode$b);
|
|
1321
1341
|
/**
|
|
1322
1342
|
* @license lucide-react v1.8.0 - ISC
|
|
1323
1343
|
*
|
|
1324
1344
|
* This source code is licensed under the ISC license.
|
|
1325
1345
|
* See the LICENSE file in the root directory of this source tree.
|
|
1326
1346
|
*/
|
|
1327
|
-
const __iconNode$
|
|
1347
|
+
const __iconNode$a = [
|
|
1348
|
+
[
|
|
1349
|
+
"path",
|
|
1350
|
+
{
|
|
1351
|
+
d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
|
|
1352
|
+
key: "1i5ecw"
|
|
1353
|
+
}
|
|
1354
|
+
],
|
|
1355
|
+
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
1356
|
+
];
|
|
1357
|
+
const Settings = createLucideIcon("settings", __iconNode$a);
|
|
1358
|
+
/**
|
|
1359
|
+
* @license lucide-react v1.8.0 - ISC
|
|
1360
|
+
*
|
|
1361
|
+
* This source code is licensed under the ISC license.
|
|
1362
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1363
|
+
*/
|
|
1364
|
+
const __iconNode$9 = [
|
|
1328
1365
|
["path", { d: "M16 4H9a3 3 0 0 0-2.83 4", key: "43sutm" }],
|
|
1329
1366
|
["path", { d: "M14 12a4 4 0 0 1 0 8H6", key: "nlfj13" }],
|
|
1330
1367
|
["line", { x1: "4", x2: "20", y1: "12", y2: "12", key: "1e0a9i" }]
|
|
1331
1368
|
];
|
|
1332
|
-
const Strikethrough = createLucideIcon("strikethrough", __iconNode$
|
|
1369
|
+
const Strikethrough = createLucideIcon("strikethrough", __iconNode$9);
|
|
1333
1370
|
/**
|
|
1334
1371
|
* @license lucide-react v1.8.0 - ISC
|
|
1335
1372
|
*
|
|
1336
1373
|
* This source code is licensed under the ISC license.
|
|
1337
1374
|
* See the LICENSE file in the root directory of this source tree.
|
|
1338
1375
|
*/
|
|
1339
|
-
const __iconNode$
|
|
1376
|
+
const __iconNode$8 = [
|
|
1340
1377
|
["path", { d: "M21 5H3", key: "1fi0y6" }],
|
|
1341
1378
|
["path", { d: "M17 12H7", key: "16if0g" }],
|
|
1342
1379
|
["path", { d: "M19 19H5", key: "vjpgq2" }]
|
|
1343
1380
|
];
|
|
1344
|
-
const TextAlignCenter = createLucideIcon("text-align-center", __iconNode$
|
|
1381
|
+
const TextAlignCenter = createLucideIcon("text-align-center", __iconNode$8);
|
|
1345
1382
|
/**
|
|
1346
1383
|
* @license lucide-react v1.8.0 - ISC
|
|
1347
1384
|
*
|
|
1348
1385
|
* This source code is licensed under the ISC license.
|
|
1349
1386
|
* See the LICENSE file in the root directory of this source tree.
|
|
1350
1387
|
*/
|
|
1351
|
-
const __iconNode$
|
|
1388
|
+
const __iconNode$7 = [
|
|
1352
1389
|
["path", { d: "M21 5H3", key: "1fi0y6" }],
|
|
1353
1390
|
["path", { d: "M21 12H9", key: "dn1m92" }],
|
|
1354
1391
|
["path", { d: "M21 19H7", key: "4cu937" }]
|
|
1355
1392
|
];
|
|
1356
|
-
const TextAlignEnd = createLucideIcon("text-align-end", __iconNode$
|
|
1393
|
+
const TextAlignEnd = createLucideIcon("text-align-end", __iconNode$7);
|
|
1357
1394
|
/**
|
|
1358
1395
|
* @license lucide-react v1.8.0 - ISC
|
|
1359
1396
|
*
|
|
1360
1397
|
* This source code is licensed under the ISC license.
|
|
1361
1398
|
* See the LICENSE file in the root directory of this source tree.
|
|
1362
1399
|
*/
|
|
1363
|
-
const __iconNode$
|
|
1400
|
+
const __iconNode$6 = [
|
|
1364
1401
|
["path", { d: "M3 5h18", key: "1u36vt" }],
|
|
1365
1402
|
["path", { d: "M3 12h18", key: "1i2n21" }],
|
|
1366
1403
|
["path", { d: "M3 19h18", key: "awlh7x" }]
|
|
1367
1404
|
];
|
|
1368
|
-
const TextAlignJustify = createLucideIcon("text-align-justify", __iconNode$
|
|
1405
|
+
const TextAlignJustify = createLucideIcon("text-align-justify", __iconNode$6);
|
|
1369
1406
|
/**
|
|
1370
1407
|
* @license lucide-react v1.8.0 - ISC
|
|
1371
1408
|
*
|
|
1372
1409
|
* This source code is licensed under the ISC license.
|
|
1373
1410
|
* See the LICENSE file in the root directory of this source tree.
|
|
1374
1411
|
*/
|
|
1375
|
-
const __iconNode$
|
|
1412
|
+
const __iconNode$5 = [
|
|
1376
1413
|
["path", { d: "M21 5H3", key: "1fi0y6" }],
|
|
1377
1414
|
["path", { d: "M15 12H3", key: "6jk70r" }],
|
|
1378
1415
|
["path", { d: "M17 19H3", key: "z6ezky" }]
|
|
1379
1416
|
];
|
|
1380
|
-
const TextAlignStart = createLucideIcon("text-align-start", __iconNode$
|
|
1417
|
+
const TextAlignStart = createLucideIcon("text-align-start", __iconNode$5);
|
|
1381
1418
|
/**
|
|
1382
1419
|
* @license lucide-react v1.8.0 - ISC
|
|
1383
1420
|
*
|
|
1384
1421
|
* This source code is licensed under the ISC license.
|
|
1385
1422
|
* See the LICENSE file in the root directory of this source tree.
|
|
1386
1423
|
*/
|
|
1387
|
-
const __iconNode$
|
|
1424
|
+
const __iconNode$4 = [
|
|
1388
1425
|
["path", { d: "M10 11v6", key: "nco0om" }],
|
|
1389
1426
|
["path", { d: "M14 11v6", key: "outv1u" }],
|
|
1390
1427
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
1391
1428
|
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
1392
1429
|
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
1393
1430
|
];
|
|
1394
|
-
const Trash2 = createLucideIcon("trash-2", __iconNode$
|
|
1431
|
+
const Trash2 = createLucideIcon("trash-2", __iconNode$4);
|
|
1432
|
+
/**
|
|
1433
|
+
* @license lucide-react v1.8.0 - ISC
|
|
1434
|
+
*
|
|
1435
|
+
* This source code is licensed under the ISC license.
|
|
1436
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
1437
|
+
*/
|
|
1438
|
+
const __iconNode$3 = [
|
|
1439
|
+
["path", { d: "M12 4v16", key: "1654pz" }],
|
|
1440
|
+
["path", { d: "M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2", key: "e0r10z" }],
|
|
1441
|
+
["path", { d: "M9 20h6", key: "s66wpe" }]
|
|
1442
|
+
];
|
|
1443
|
+
const Type = createLucideIcon("type", __iconNode$3);
|
|
1395
1444
|
/**
|
|
1396
1445
|
* @license lucide-react v1.8.0 - ISC
|
|
1397
1446
|
*
|
|
@@ -1491,10 +1540,92 @@ const DEFAULT_TRANSLATIONS = {
|
|
|
1491
1540
|
footer: {
|
|
1492
1541
|
placeholder: "Footer"
|
|
1493
1542
|
},
|
|
1543
|
+
body: {
|
|
1544
|
+
placeholder: "Start typing..."
|
|
1545
|
+
},
|
|
1546
|
+
headerFooter: {
|
|
1547
|
+
label: "Headers & Footers"
|
|
1548
|
+
},
|
|
1494
1549
|
sidebar: {
|
|
1495
1550
|
close: "Close sidebar"
|
|
1496
1551
|
}
|
|
1497
1552
|
};
|
|
1553
|
+
const PT_BR_TRANSLATIONS = {
|
|
1554
|
+
toolbar: {
|
|
1555
|
+
undo: "Desfazer",
|
|
1556
|
+
redo: "Refazer",
|
|
1557
|
+
bold: "Negrito (Ctrl+B)",
|
|
1558
|
+
italic: "Itálico (Ctrl+I)",
|
|
1559
|
+
underline: "Sublinhado (Ctrl+U)",
|
|
1560
|
+
strikethrough: "Tachado",
|
|
1561
|
+
alignLeft: "Alinhar à Esquerda",
|
|
1562
|
+
alignCenter: "Centralizar",
|
|
1563
|
+
alignRight: "Alinhar à Direita",
|
|
1564
|
+
justify: "Justificar",
|
|
1565
|
+
numberedList: "Lista Numerada",
|
|
1566
|
+
bulletList: "Lista com Marcadores",
|
|
1567
|
+
indent: "Aumentar Recuo",
|
|
1568
|
+
outdent: "Diminuir Recuo",
|
|
1569
|
+
openHistory: "Abrir Histórico",
|
|
1570
|
+
closeHistory: "Fechar Histórico"
|
|
1571
|
+
},
|
|
1572
|
+
history: {
|
|
1573
|
+
title: "Histórico",
|
|
1574
|
+
subtitle: "Histórico de sessão (últimas 100 ações)",
|
|
1575
|
+
empty: "Nenhum histórico ainda.",
|
|
1576
|
+
clearHistory: "Limpar Histórico",
|
|
1577
|
+
actions: {
|
|
1578
|
+
enabledHeadersFooters: "Cabeçalhos e rodapés ativados",
|
|
1579
|
+
disabledHeadersFooters: "Cabeçalhos e rodapés desativados",
|
|
1580
|
+
copiedHeaderToAll: "Cabeçalho copiado para todas as páginas",
|
|
1581
|
+
copiedFooterToAll: "Rodapé copiado para todas as páginas",
|
|
1582
|
+
clearedHeader: "Cabeçalho limpo",
|
|
1583
|
+
clearedFooter: "Rodapé limpo",
|
|
1584
|
+
clearedAllHeaders: "Todos os cabeçalhos limpos",
|
|
1585
|
+
clearedAllFooters: "Todos os rodapés limpos",
|
|
1586
|
+
pageCounterSet: "Contador de páginas definido como {{value}}",
|
|
1587
|
+
boldApplied: "Negrito aplicado",
|
|
1588
|
+
italicApplied: "Itálico aplicado",
|
|
1589
|
+
underlineApplied: "Sublinhado aplicado",
|
|
1590
|
+
strikethroughApplied: "Tachado aplicado",
|
|
1591
|
+
alignedLeft: "Alinhado à esquerda",
|
|
1592
|
+
alignedCenter: "Centralizado",
|
|
1593
|
+
alignedRight: "Alinhado à direita",
|
|
1594
|
+
justifiedText: "Texto justificado",
|
|
1595
|
+
insertedNumberedList: "Lista numerada inserida",
|
|
1596
|
+
insertedBulletList: "Lista com marcadores inserida",
|
|
1597
|
+
indentedContent: "Conteúdo recuado",
|
|
1598
|
+
outdentedContent: "Recuo reduzido",
|
|
1599
|
+
fontChanged: "Fonte alterada para {{value}}",
|
|
1600
|
+
fontSizeChanged: "Tamanho da fonte alterado para {{value}}pt"
|
|
1601
|
+
}
|
|
1602
|
+
},
|
|
1603
|
+
variables: {
|
|
1604
|
+
title: "Variáveis",
|
|
1605
|
+
available: "{{count}} disponíveis",
|
|
1606
|
+
refreshVariables: "Atualizar variáveis",
|
|
1607
|
+
searchPlaceholder: "Buscar variáveis...",
|
|
1608
|
+
noVariablesFound: "Nenhuma variável encontrada",
|
|
1609
|
+
insertVariable: "Inserir variável {{key}}",
|
|
1610
|
+
openPanel: "Abrir Variáveis",
|
|
1611
|
+
closePanel: "Fechar Variáveis"
|
|
1612
|
+
},
|
|
1613
|
+
header: {
|
|
1614
|
+
placeholder: "Cabeçalho"
|
|
1615
|
+
},
|
|
1616
|
+
footer: {
|
|
1617
|
+
placeholder: "Rodapé"
|
|
1618
|
+
},
|
|
1619
|
+
body: {
|
|
1620
|
+
placeholder: "Comece a digitar..."
|
|
1621
|
+
},
|
|
1622
|
+
headerFooter: {
|
|
1623
|
+
label: "Cabeçalhos e Rodapés"
|
|
1624
|
+
},
|
|
1625
|
+
sidebar: {
|
|
1626
|
+
close: "Fechar barra lateral"
|
|
1627
|
+
}
|
|
1628
|
+
};
|
|
1498
1629
|
function deepMerge(target, source) {
|
|
1499
1630
|
if (typeof target !== "object" || target === null) {
|
|
1500
1631
|
return source ?? target;
|
|
@@ -1651,13 +1782,15 @@ const HeaderFooterToggle = ({
|
|
|
1651
1782
|
enabled,
|
|
1652
1783
|
onToggle
|
|
1653
1784
|
}) => {
|
|
1785
|
+
const t = useTranslations();
|
|
1654
1786
|
return /* @__PURE__ */ jsxs(
|
|
1655
1787
|
"label",
|
|
1656
1788
|
{
|
|
1657
1789
|
className: "flex items-center gap-1.5 cursor-pointer select-none",
|
|
1658
1790
|
"data-testid": "header-footer-toggle",
|
|
1659
1791
|
children: [
|
|
1660
|
-
/* @__PURE__ */ jsx(
|
|
1792
|
+
/* @__PURE__ */ jsx(Rows3, { size: 14, className: "text-gray-500" }),
|
|
1793
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-gray-600", children: t.headerFooter.label }),
|
|
1661
1794
|
/* @__PURE__ */ jsx(
|
|
1662
1795
|
"button",
|
|
1663
1796
|
{
|
|
@@ -1688,6 +1821,12 @@ const HeaderFooterToggle = ({
|
|
|
1688
1821
|
}
|
|
1689
1822
|
);
|
|
1690
1823
|
};
|
|
1824
|
+
const PAGE_COUNTER_OPTIONS = [
|
|
1825
|
+
{ value: "none", label: "None" },
|
|
1826
|
+
{ value: "header", label: "Header" },
|
|
1827
|
+
{ value: "footer", label: "Footer" },
|
|
1828
|
+
{ value: "both", label: "Both" }
|
|
1829
|
+
];
|
|
1691
1830
|
const HeaderFooterActions = ({
|
|
1692
1831
|
activePageId,
|
|
1693
1832
|
pageCounterMode,
|
|
@@ -1699,119 +1838,154 @@ const HeaderFooterActions = ({
|
|
|
1699
1838
|
onClearAllHeaders,
|
|
1700
1839
|
onClearAllFooters
|
|
1701
1840
|
}) => {
|
|
1841
|
+
const [open, setOpen] = useState(false);
|
|
1842
|
+
const containerRef = useRef(null);
|
|
1702
1843
|
const hasActivePage = activePageId !== null;
|
|
1703
|
-
const
|
|
1704
|
-
|
|
1705
|
-
if (
|
|
1706
|
-
|
|
1707
|
-
|
|
1844
|
+
const close = useCallback(() => setOpen(false), []);
|
|
1845
|
+
useEffect(() => {
|
|
1846
|
+
if (!open) return;
|
|
1847
|
+
const handleClickOutside = (e) => {
|
|
1848
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
1849
|
+
close();
|
|
1850
|
+
}
|
|
1851
|
+
};
|
|
1852
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1853
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1854
|
+
}, [open, close]);
|
|
1855
|
+
const handleAction = (action) => {
|
|
1856
|
+
action();
|
|
1857
|
+
close();
|
|
1708
1858
|
};
|
|
1709
|
-
return /* @__PURE__ */ jsxs(
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1859
|
+
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: "relative", "data-testid": "header-footer-actions", children: [
|
|
1860
|
+
/* @__PURE__ */ jsxs(
|
|
1861
|
+
"button",
|
|
1862
|
+
{
|
|
1863
|
+
type: "button",
|
|
1864
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1865
|
+
onClick: () => setOpen(!open),
|
|
1866
|
+
className: `
|
|
1867
|
+
flex h-7 items-center gap-1 rounded px-1.5 text-xs transition-colors
|
|
1868
|
+
${open ? "bg-blue-50 text-blue-600" : "text-gray-600 hover:bg-gray-100 hover:text-gray-900"}
|
|
1869
|
+
`,
|
|
1870
|
+
"data-testid": "header-footer-menu-trigger",
|
|
1871
|
+
"aria-expanded": open,
|
|
1872
|
+
"aria-haspopup": "true",
|
|
1873
|
+
children: [
|
|
1874
|
+
/* @__PURE__ */ jsx(Settings, { size: 14 }),
|
|
1875
|
+
/* @__PURE__ */ jsx(ChevronDown, { size: 12 })
|
|
1876
|
+
]
|
|
1877
|
+
}
|
|
1878
|
+
),
|
|
1879
|
+
open && /* @__PURE__ */ jsxs(
|
|
1880
|
+
"div",
|
|
1881
|
+
{
|
|
1882
|
+
className: "absolute left-0 top-full mt-1 z-50 w-56 rounded-lg border border-gray-200 bg-white py-1 shadow-lg",
|
|
1883
|
+
role: "menu",
|
|
1884
|
+
"data-testid": "header-footer-menu",
|
|
1885
|
+
children: [
|
|
1886
|
+
/* @__PURE__ */ jsx(SectionLabel, { children: "Page counter" }),
|
|
1887
|
+
/* @__PURE__ */ jsx("div", { className: "px-3 pb-2 grid grid-cols-2 gap-1", "data-testid": "page-counter-mode", children: PAGE_COUNTER_OPTIONS.map(({ value, label }) => /* @__PURE__ */ jsx(
|
|
1888
|
+
"button",
|
|
1719
1889
|
{
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
"
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1890
|
+
type: "button",
|
|
1891
|
+
role: "menuitemradio",
|
|
1892
|
+
"aria-checked": pageCounterMode === value,
|
|
1893
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1894
|
+
onClick: () => onPageCounterModeChange(value),
|
|
1895
|
+
className: `
|
|
1896
|
+
rounded px-2 py-1 text-xs text-left transition-colors
|
|
1897
|
+
${pageCounterMode === value ? "bg-blue-50 text-blue-700 font-medium" : "text-gray-600 hover:bg-gray-100"}
|
|
1898
|
+
`,
|
|
1899
|
+
"data-testid": `page-counter-${value}`,
|
|
1900
|
+
children: label
|
|
1901
|
+
},
|
|
1902
|
+
value
|
|
1903
|
+
)) }),
|
|
1904
|
+
/* @__PURE__ */ jsx(MenuDivider, {}),
|
|
1905
|
+
/* @__PURE__ */ jsx(SectionLabel, { children: "Header" }),
|
|
1906
|
+
/* @__PURE__ */ jsx(
|
|
1907
|
+
MenuItem,
|
|
1908
|
+
{
|
|
1909
|
+
icon: /* @__PURE__ */ jsx(CopyPlus, { size: 14 }),
|
|
1910
|
+
label: "Copy to all pages",
|
|
1911
|
+
onClick: () => handleAction(onCopyHeaderToAll),
|
|
1912
|
+
disabled: !hasActivePage,
|
|
1913
|
+
testId: "copy-header-all"
|
|
1914
|
+
}
|
|
1915
|
+
),
|
|
1916
|
+
/* @__PURE__ */ jsx(
|
|
1917
|
+
MenuItem,
|
|
1918
|
+
{
|
|
1919
|
+
icon: /* @__PURE__ */ jsx(Eraser, { size: 14 }),
|
|
1920
|
+
label: "Clear this page",
|
|
1921
|
+
onClick: () => handleAction(onClearHeader),
|
|
1922
|
+
disabled: !hasActivePage,
|
|
1923
|
+
testId: "clear-header"
|
|
1924
|
+
}
|
|
1925
|
+
),
|
|
1926
|
+
/* @__PURE__ */ jsx(
|
|
1927
|
+
MenuItem,
|
|
1928
|
+
{
|
|
1929
|
+
icon: /* @__PURE__ */ jsx(Trash2, { size: 14 }),
|
|
1930
|
+
label: "Clear all",
|
|
1931
|
+
onClick: () => handleAction(onClearAllHeaders),
|
|
1932
|
+
testId: "clear-all-headers"
|
|
1933
|
+
}
|
|
1934
|
+
),
|
|
1935
|
+
/* @__PURE__ */ jsx(MenuDivider, {}),
|
|
1936
|
+
/* @__PURE__ */ jsx(SectionLabel, { children: "Footer" }),
|
|
1937
|
+
/* @__PURE__ */ jsx(
|
|
1938
|
+
MenuItem,
|
|
1939
|
+
{
|
|
1940
|
+
icon: /* @__PURE__ */ jsx(CopyPlus, { size: 14 }),
|
|
1941
|
+
label: "Copy to all pages",
|
|
1942
|
+
onClick: () => handleAction(onCopyFooterToAll),
|
|
1943
|
+
disabled: !hasActivePage,
|
|
1944
|
+
testId: "copy-footer-all"
|
|
1945
|
+
}
|
|
1946
|
+
),
|
|
1947
|
+
/* @__PURE__ */ jsx(
|
|
1948
|
+
MenuItem,
|
|
1949
|
+
{
|
|
1950
|
+
icon: /* @__PURE__ */ jsx(Eraser, { size: 14 }),
|
|
1951
|
+
label: "Clear this page",
|
|
1952
|
+
onClick: () => handleAction(onClearFooter),
|
|
1953
|
+
disabled: !hasActivePage,
|
|
1954
|
+
testId: "clear-footer"
|
|
1955
|
+
}
|
|
1956
|
+
),
|
|
1957
|
+
/* @__PURE__ */ jsx(
|
|
1958
|
+
MenuItem,
|
|
1959
|
+
{
|
|
1960
|
+
icon: /* @__PURE__ */ jsx(Trash2, { size: 14 }),
|
|
1961
|
+
label: "Clear all",
|
|
1962
|
+
onClick: () => handleAction(onClearAllFooters),
|
|
1963
|
+
testId: "clear-all-footers"
|
|
1731
1964
|
}
|
|
1732
1965
|
)
|
|
1733
|
-
]
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
ActionIconButton,
|
|
1738
|
-
{
|
|
1739
|
-
title: "Copy header to all pages",
|
|
1740
|
-
icon: /* @__PURE__ */ jsx(CopyPlus, { size: 13 }),
|
|
1741
|
-
onClick: onCopyHeaderToAll,
|
|
1742
|
-
disabled: !hasActivePage,
|
|
1743
|
-
testId: "copy-header-all"
|
|
1744
|
-
}
|
|
1745
|
-
),
|
|
1746
|
-
/* @__PURE__ */ jsx(
|
|
1747
|
-
ActionIconButton,
|
|
1748
|
-
{
|
|
1749
|
-
title: "Clear header on this page",
|
|
1750
|
-
icon: /* @__PURE__ */ jsx(Eraser, { size: 13 }),
|
|
1751
|
-
onClick: onClearHeader,
|
|
1752
|
-
disabled: !hasActivePage,
|
|
1753
|
-
testId: "clear-header"
|
|
1754
|
-
}
|
|
1755
|
-
),
|
|
1756
|
-
/* @__PURE__ */ jsx(
|
|
1757
|
-
ActionIconButton,
|
|
1758
|
-
{
|
|
1759
|
-
title: "Clear all headers",
|
|
1760
|
-
icon: /* @__PURE__ */ jsx(Trash2, { size: 13 }),
|
|
1761
|
-
onClick: onClearAllHeaders,
|
|
1762
|
-
testId: "clear-all-headers"
|
|
1763
|
-
}
|
|
1764
|
-
),
|
|
1765
|
-
/* @__PURE__ */ jsx(ActionDivider, {}),
|
|
1766
|
-
/* @__PURE__ */ jsx("span", { className: "text-gray-400 font-medium", children: "Footer" }),
|
|
1767
|
-
/* @__PURE__ */ jsx(
|
|
1768
|
-
ActionIconButton,
|
|
1769
|
-
{
|
|
1770
|
-
title: "Copy footer to all pages",
|
|
1771
|
-
icon: /* @__PURE__ */ jsx(CopyPlus, { size: 13 }),
|
|
1772
|
-
onClick: onCopyFooterToAll,
|
|
1773
|
-
disabled: !hasActivePage,
|
|
1774
|
-
testId: "copy-footer-all"
|
|
1775
|
-
}
|
|
1776
|
-
),
|
|
1777
|
-
/* @__PURE__ */ jsx(
|
|
1778
|
-
ActionIconButton,
|
|
1779
|
-
{
|
|
1780
|
-
title: "Clear footer on this page",
|
|
1781
|
-
icon: /* @__PURE__ */ jsx(Eraser, { size: 13 }),
|
|
1782
|
-
onClick: onClearFooter,
|
|
1783
|
-
disabled: !hasActivePage,
|
|
1784
|
-
testId: "clear-footer"
|
|
1785
|
-
}
|
|
1786
|
-
),
|
|
1787
|
-
/* @__PURE__ */ jsx(
|
|
1788
|
-
ActionIconButton,
|
|
1789
|
-
{
|
|
1790
|
-
title: "Clear all footers",
|
|
1791
|
-
icon: /* @__PURE__ */ jsx(Trash2, { size: 13 }),
|
|
1792
|
-
onClick: onClearAllFooters,
|
|
1793
|
-
testId: "clear-all-footers"
|
|
1794
|
-
}
|
|
1795
|
-
)
|
|
1796
|
-
]
|
|
1797
|
-
}
|
|
1798
|
-
);
|
|
1966
|
+
]
|
|
1967
|
+
}
|
|
1968
|
+
)
|
|
1969
|
+
] });
|
|
1799
1970
|
};
|
|
1800
|
-
const
|
|
1971
|
+
const SectionLabel = ({ children }) => /* @__PURE__ */ jsx("div", { className: "px-3 pt-2 pb-1 text-[10px] font-semibold uppercase tracking-wider text-gray-400", children });
|
|
1972
|
+
const MenuItem = ({ icon, label, onClick, disabled, testId }) => /* @__PURE__ */ jsxs(
|
|
1801
1973
|
"button",
|
|
1802
1974
|
{
|
|
1803
1975
|
type: "button",
|
|
1804
|
-
|
|
1805
|
-
"aria-label": title,
|
|
1976
|
+
role: "menuitem",
|
|
1806
1977
|
onMouseDown: (e) => e.preventDefault(),
|
|
1807
1978
|
onClick,
|
|
1808
1979
|
disabled,
|
|
1809
|
-
className: "flex
|
|
1980
|
+
className: "flex w-full items-center gap-2 px-3 py-1.5 text-xs text-gray-700 transition-colors\n hover:bg-gray-50 disabled:cursor-not-allowed disabled:text-gray-300",
|
|
1810
1981
|
"data-testid": testId,
|
|
1811
|
-
children:
|
|
1982
|
+
children: [
|
|
1983
|
+
icon,
|
|
1984
|
+
label
|
|
1985
|
+
]
|
|
1812
1986
|
}
|
|
1813
1987
|
);
|
|
1814
|
-
const
|
|
1988
|
+
const MenuDivider = () => /* @__PURE__ */ jsx("div", { className: "my-1 h-px bg-gray-100" });
|
|
1815
1989
|
function resolveExtensions(extensions) {
|
|
1816
1990
|
const resolved = {
|
|
1817
1991
|
nodes: [],
|
|
@@ -1886,10 +2060,10 @@ function useExtensionContext(getDocument, getActiveEditor) {
|
|
|
1886
2060
|
}), [getDocument, getActiveEditor, stateRef]);
|
|
1887
2061
|
}
|
|
1888
2062
|
const SUPPORTED_FONTS = [
|
|
2063
|
+
"Calibri",
|
|
1889
2064
|
"Inter",
|
|
1890
2065
|
"Times New Roman",
|
|
1891
2066
|
"Arial",
|
|
1892
|
-
"Calibri",
|
|
1893
2067
|
"Georgia",
|
|
1894
2068
|
"Courier New"
|
|
1895
2069
|
];
|
|
@@ -2153,87 +2327,107 @@ const Toolbar = () => {
|
|
|
2153
2327
|
},
|
|
2154
2328
|
[applyToBodyEditors, runToolbarAction, t.history.actions.fontSizeChanged]
|
|
2155
2329
|
);
|
|
2156
|
-
return /* @__PURE__ */
|
|
2330
|
+
return /* @__PURE__ */ jsxs(
|
|
2157
2331
|
"div",
|
|
2158
2332
|
{
|
|
2159
2333
|
className: "lex4-toolbar sticky top-0 z-10 bg-white border-b border-gray-200",
|
|
2160
2334
|
"data-testid": "toolbar",
|
|
2161
|
-
children:
|
|
2162
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-
|
|
2163
|
-
/* @__PURE__ */
|
|
2335
|
+
children: [
|
|
2336
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 px-2 py-1.5", children: [
|
|
2337
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5", "data-testid": "history-controls", children: [
|
|
2338
|
+
/* @__PURE__ */ jsx(
|
|
2339
|
+
ToolbarIconButton,
|
|
2340
|
+
{
|
|
2341
|
+
title: t.toolbar.undo,
|
|
2342
|
+
testId: "btn-undo",
|
|
2343
|
+
disabled: !canUndo,
|
|
2344
|
+
onClick: undo,
|
|
2345
|
+
children: /* @__PURE__ */ jsx(Undo2, { size: 15 })
|
|
2346
|
+
}
|
|
2347
|
+
),
|
|
2348
|
+
/* @__PURE__ */ jsx(
|
|
2349
|
+
ToolbarIconButton,
|
|
2350
|
+
{
|
|
2351
|
+
title: t.toolbar.redo,
|
|
2352
|
+
testId: "btn-redo",
|
|
2353
|
+
disabled: !canRedo,
|
|
2354
|
+
onClick: redo,
|
|
2355
|
+
children: /* @__PURE__ */ jsx(Redo2, { size: 15 })
|
|
2356
|
+
}
|
|
2357
|
+
)
|
|
2358
|
+
] }),
|
|
2359
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
2360
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
2361
|
+
/* @__PURE__ */ jsx(Type, { size: 14, className: "text-gray-500" }),
|
|
2362
|
+
/* @__PURE__ */ jsx(
|
|
2363
|
+
"select",
|
|
2364
|
+
{
|
|
2365
|
+
className: "h-7 rounded border border-gray-200 bg-white px-2 text-xs text-gray-700\n focus:border-blue-400 focus:outline-none focus:ring-1 focus:ring-blue-400",
|
|
2366
|
+
"data-testid": "font-selector",
|
|
2367
|
+
defaultValue: "Calibri",
|
|
2368
|
+
onChange: handleFontChange,
|
|
2369
|
+
children: SUPPORTED_FONTS.map((font) => /* @__PURE__ */ jsx("option", { value: font, style: { fontFamily: font }, children: font }, font))
|
|
2370
|
+
}
|
|
2371
|
+
)
|
|
2372
|
+
] }),
|
|
2373
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
2374
|
+
/* @__PURE__ */ jsx(ALargeSmall, { size: 14, className: "text-gray-500" }),
|
|
2375
|
+
/* @__PURE__ */ jsx(
|
|
2376
|
+
"select",
|
|
2377
|
+
{
|
|
2378
|
+
className: "h-7 w-16 rounded border border-gray-200 bg-white px-1 text-xs text-gray-700\n focus:border-blue-400 focus:outline-none focus:ring-1 focus:ring-blue-400",
|
|
2379
|
+
"data-testid": "font-size-selector",
|
|
2380
|
+
defaultValue: "12",
|
|
2381
|
+
onChange: handleFontSizeChange,
|
|
2382
|
+
children: SUPPORTED_FONT_SIZES.map((size) => /* @__PURE__ */ jsx("option", { value: size, children: size }, size))
|
|
2383
|
+
}
|
|
2384
|
+
)
|
|
2385
|
+
] }),
|
|
2386
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
2387
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5", "data-testid": "format-group", children: [
|
|
2388
|
+
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.bold, testId: "btn-bold", onClick: handleBold, children: /* @__PURE__ */ jsx(Bold, { size: 15 }) }),
|
|
2389
|
+
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.italic, testId: "btn-italic", onClick: handleItalic, children: /* @__PURE__ */ jsx(Italic, { size: 15 }) }),
|
|
2390
|
+
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.underline, testId: "btn-underline", onClick: handleUnderline, children: /* @__PURE__ */ jsx(Underline, { size: 15 }) }),
|
|
2391
|
+
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.strikethrough, testId: "btn-strike", onClick: handleStrikethrough, children: /* @__PURE__ */ jsx(Strikethrough, { size: 15 }) })
|
|
2392
|
+
] }),
|
|
2393
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
2394
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5", "data-testid": "align-group", children: [
|
|
2395
|
+
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.alignLeft, testId: "btn-align-left", onClick: handleAlignLeft, children: /* @__PURE__ */ jsx(TextAlignStart, { size: 15 }) }),
|
|
2396
|
+
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.alignCenter, testId: "btn-align-center", onClick: handleAlignCenter, children: /* @__PURE__ */ jsx(TextAlignCenter, { size: 15 }) }),
|
|
2397
|
+
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.alignRight, testId: "btn-align-right", onClick: handleAlignRight, children: /* @__PURE__ */ jsx(TextAlignEnd, { size: 15 }) }),
|
|
2398
|
+
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.justify, testId: "btn-align-justify", onClick: handleAlignJustify, children: /* @__PURE__ */ jsx(TextAlignJustify, { size: 15 }) })
|
|
2399
|
+
] }),
|
|
2400
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
2401
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5", "data-testid": "list-group", children: [
|
|
2402
|
+
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.numberedList, testId: "btn-list-number", onClick: handleListNumber, children: /* @__PURE__ */ jsx(ListOrdered, { size: 15 }) }),
|
|
2403
|
+
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.bulletList, testId: "btn-list-bullet", onClick: handleListBullet, children: /* @__PURE__ */ jsx(List, { size: 15 }) }),
|
|
2404
|
+
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.indent, testId: "btn-indent", onClick: handleIndent, children: /* @__PURE__ */ jsx(ListIndentIncrease, { size: 15 }) }),
|
|
2405
|
+
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.outdent, testId: "btn-outdent", onClick: handleOutdent, children: /* @__PURE__ */ jsx(ListIndentDecrease, { size: 15 }) })
|
|
2406
|
+
] }),
|
|
2407
|
+
toolbarItems.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2408
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
2409
|
+
toolbarItems.map((ToolbarItem, idx) => /* @__PURE__ */ jsx(ToolbarItem, {}, idx))
|
|
2410
|
+
] }),
|
|
2411
|
+
/* @__PURE__ */ jsx("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx(
|
|
2164
2412
|
ToolbarIconButton,
|
|
2165
2413
|
{
|
|
2166
|
-
title: t.toolbar.
|
|
2167
|
-
testId: "
|
|
2168
|
-
|
|
2169
|
-
onClick:
|
|
2170
|
-
children: /* @__PURE__ */ jsx(
|
|
2414
|
+
title: historySidebarOpen ? t.toolbar.closeHistory : t.toolbar.openHistory,
|
|
2415
|
+
testId: "toggle-history-sidebar",
|
|
2416
|
+
active: historySidebarOpen,
|
|
2417
|
+
onClick: () => setHistorySidebarOpen(!historySidebarOpen),
|
|
2418
|
+
children: /* @__PURE__ */ jsx(PanelRight, { size: 15 })
|
|
2171
2419
|
}
|
|
2172
|
-
)
|
|
2420
|
+
) })
|
|
2421
|
+
] }),
|
|
2422
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 px-2 py-1 border-t border-gray-100", children: [
|
|
2173
2423
|
/* @__PURE__ */ jsx(
|
|
2174
|
-
|
|
2424
|
+
HeaderFooterToggle,
|
|
2175
2425
|
{
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
disabled: !canRedo,
|
|
2179
|
-
onClick: redo,
|
|
2180
|
-
children: /* @__PURE__ */ jsx(Redo2, { size: 15 })
|
|
2426
|
+
enabled: document2.headerFooterEnabled,
|
|
2427
|
+
onToggle: handleToggle
|
|
2181
2428
|
}
|
|
2182
|
-
)
|
|
2183
|
-
|
|
2184
|
-
/* @__PURE__ */ jsx(Divider, {}),
|
|
2185
|
-
/* @__PURE__ */ jsx(
|
|
2186
|
-
"select",
|
|
2187
|
-
{
|
|
2188
|
-
className: "h-7 rounded border border-gray-200 bg-white px-2 text-xs text-gray-700\n focus:border-blue-400 focus:outline-none focus:ring-1 focus:ring-blue-400",
|
|
2189
|
-
"data-testid": "font-selector",
|
|
2190
|
-
defaultValue: "Inter",
|
|
2191
|
-
onChange: handleFontChange,
|
|
2192
|
-
children: SUPPORTED_FONTS.map((font) => /* @__PURE__ */ jsx("option", { value: font, style: { fontFamily: font }, children: font }, font))
|
|
2193
|
-
}
|
|
2194
|
-
),
|
|
2195
|
-
/* @__PURE__ */ jsx(
|
|
2196
|
-
"select",
|
|
2197
|
-
{
|
|
2198
|
-
className: "h-7 w-16 rounded border border-gray-200 bg-white px-1 text-xs text-gray-700\n focus:border-blue-400 focus:outline-none focus:ring-1 focus:ring-blue-400",
|
|
2199
|
-
"data-testid": "font-size-selector",
|
|
2200
|
-
defaultValue: "12",
|
|
2201
|
-
onChange: handleFontSizeChange,
|
|
2202
|
-
children: SUPPORTED_FONT_SIZES.map((size) => /* @__PURE__ */ jsx("option", { value: size, children: size }, size))
|
|
2203
|
-
}
|
|
2204
|
-
),
|
|
2205
|
-
/* @__PURE__ */ jsx(Divider, {}),
|
|
2206
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5", "data-testid": "format-group", children: [
|
|
2207
|
-
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.bold, testId: "btn-bold", onClick: handleBold, children: /* @__PURE__ */ jsx(Bold, { size: 15 }) }),
|
|
2208
|
-
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.italic, testId: "btn-italic", onClick: handleItalic, children: /* @__PURE__ */ jsx(Italic, { size: 15 }) }),
|
|
2209
|
-
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.underline, testId: "btn-underline", onClick: handleUnderline, children: /* @__PURE__ */ jsx(Underline, { size: 15 }) }),
|
|
2210
|
-
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.strikethrough, testId: "btn-strike", onClick: handleStrikethrough, children: /* @__PURE__ */ jsx(Strikethrough, { size: 15 }) })
|
|
2211
|
-
] }),
|
|
2212
|
-
/* @__PURE__ */ jsx(Divider, {}),
|
|
2213
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5", "data-testid": "align-group", children: [
|
|
2214
|
-
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.alignLeft, testId: "btn-align-left", onClick: handleAlignLeft, children: /* @__PURE__ */ jsx(TextAlignStart, { size: 15 }) }),
|
|
2215
|
-
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.alignCenter, testId: "btn-align-center", onClick: handleAlignCenter, children: /* @__PURE__ */ jsx(TextAlignCenter, { size: 15 }) }),
|
|
2216
|
-
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.alignRight, testId: "btn-align-right", onClick: handleAlignRight, children: /* @__PURE__ */ jsx(TextAlignEnd, { size: 15 }) }),
|
|
2217
|
-
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.justify, testId: "btn-align-justify", onClick: handleAlignJustify, children: /* @__PURE__ */ jsx(TextAlignJustify, { size: 15 }) })
|
|
2218
|
-
] }),
|
|
2219
|
-
/* @__PURE__ */ jsx(Divider, {}),
|
|
2220
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5", "data-testid": "list-group", children: [
|
|
2221
|
-
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.numberedList, testId: "btn-list-number", onClick: handleListNumber, children: /* @__PURE__ */ jsx(ListOrdered, { size: 15 }) }),
|
|
2222
|
-
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.bulletList, testId: "btn-list-bullet", onClick: handleListBullet, children: /* @__PURE__ */ jsx(List, { size: 15 }) }),
|
|
2223
|
-
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.indent, testId: "btn-indent", onClick: handleIndent, children: /* @__PURE__ */ jsx(ListIndentIncrease, { size: 15 }) }),
|
|
2224
|
-
/* @__PURE__ */ jsx(ToolbarIconButton, { title: t.toolbar.outdent, testId: "btn-outdent", onClick: handleOutdent, children: /* @__PURE__ */ jsx(ListIndentDecrease, { size: 15 }) })
|
|
2225
|
-
] }),
|
|
2226
|
-
/* @__PURE__ */ jsx(Divider, {}),
|
|
2227
|
-
/* @__PURE__ */ jsx(
|
|
2228
|
-
HeaderFooterToggle,
|
|
2229
|
-
{
|
|
2230
|
-
enabled: document2.headerFooterEnabled,
|
|
2231
|
-
onToggle: handleToggle
|
|
2232
|
-
}
|
|
2233
|
-
),
|
|
2234
|
-
document2.headerFooterEnabled && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2235
|
-
/* @__PURE__ */ jsx(Divider, {}),
|
|
2236
|
-
/* @__PURE__ */ jsx(
|
|
2429
|
+
),
|
|
2430
|
+
document2.headerFooterEnabled && /* @__PURE__ */ jsx(
|
|
2237
2431
|
HeaderFooterActions,
|
|
2238
2432
|
{
|
|
2239
2433
|
activePageId,
|
|
@@ -2247,22 +2441,8 @@ const Toolbar = () => {
|
|
|
2247
2441
|
onClearAllFooters: handleClearAllFooters
|
|
2248
2442
|
}
|
|
2249
2443
|
)
|
|
2250
|
-
] })
|
|
2251
|
-
|
|
2252
|
-
/* @__PURE__ */ jsx(Divider, {}),
|
|
2253
|
-
toolbarItems.map((ToolbarItem, idx) => /* @__PURE__ */ jsx(ToolbarItem, {}, idx))
|
|
2254
|
-
] }),
|
|
2255
|
-
/* @__PURE__ */ jsx("div", { className: "ml-auto flex items-center", children: /* @__PURE__ */ jsx(
|
|
2256
|
-
ToolbarIconButton,
|
|
2257
|
-
{
|
|
2258
|
-
title: historySidebarOpen ? t.toolbar.closeHistory : t.toolbar.openHistory,
|
|
2259
|
-
testId: "toggle-history-sidebar",
|
|
2260
|
-
active: historySidebarOpen,
|
|
2261
|
-
onClick: () => setHistorySidebarOpen(!historySidebarOpen),
|
|
2262
|
-
children: /* @__PURE__ */ jsx(PanelRight, { size: 15 })
|
|
2263
|
-
}
|
|
2264
|
-
) })
|
|
2265
|
-
] })
|
|
2444
|
+
] })
|
|
2445
|
+
]
|
|
2266
2446
|
}
|
|
2267
2447
|
);
|
|
2268
2448
|
};
|
|
@@ -2531,7 +2711,7 @@ function usePagination(document2, dispatch) {
|
|
|
2531
2711
|
}
|
|
2532
2712
|
const lexicalTheme = {
|
|
2533
2713
|
root: "lex4-root outline-none",
|
|
2534
|
-
paragraph: "lex4-paragraph
|
|
2714
|
+
paragraph: "lex4-paragraph text-justify",
|
|
2535
2715
|
heading: {
|
|
2536
2716
|
h1: "text-3xl font-bold mb-2",
|
|
2537
2717
|
h2: "text-2xl font-bold mb-2",
|
|
@@ -3143,6 +3323,7 @@ const PageBody = ({
|
|
|
3143
3323
|
readOnly = false
|
|
3144
3324
|
}) => {
|
|
3145
3325
|
const { nodes, bodyPlugins, themeOverrides } = useExtensions();
|
|
3326
|
+
const t = useTranslations();
|
|
3146
3327
|
const config = useMemo(
|
|
3147
3328
|
() => {
|
|
3148
3329
|
var _a, _b;
|
|
@@ -3196,7 +3377,7 @@ const PageBody = ({
|
|
|
3196
3377
|
style: { overflow: "visible" }
|
|
3197
3378
|
}
|
|
3198
3379
|
),
|
|
3199
|
-
placeholder: /* @__PURE__ */ jsx("div", { className: "absolute top-0 left-0 text-gray-400 pointer-events-none select-none", children:
|
|
3380
|
+
placeholder: /* @__PURE__ */ jsx("div", { className: "absolute top-0 left-0 text-gray-400 pointer-events-none select-none", children: t.body.placeholder }),
|
|
3200
3381
|
ErrorBoundary: LexicalErrorBoundary
|
|
3201
3382
|
}
|
|
3202
3383
|
),
|
|
@@ -3336,10 +3517,10 @@ const PageHeader = ({
|
|
|
3336
3517
|
ContentEditable,
|
|
3337
3518
|
{
|
|
3338
3519
|
ref: contentRef,
|
|
3339
|
-
className: `outline-none p-2 text-
|
|
3520
|
+
className: `outline-none p-2 text-gray-600 min-h-[24px] ${hasPageCounter ? "pr-24" : ""}`
|
|
3340
3521
|
}
|
|
3341
3522
|
),
|
|
3342
|
-
placeholder: /* @__PURE__ */ jsx("div", { className: `absolute top-0 left-0 text-gray-400 pointer-events-none select-none p-2
|
|
3523
|
+
placeholder: /* @__PURE__ */ jsx("div", { className: `absolute top-0 left-0 text-gray-400 pointer-events-none select-none p-2 ${hasPageCounter ? "pr-24" : ""}`, children: t.header.placeholder }),
|
|
3343
3524
|
ErrorBoundary: LexicalErrorBoundary
|
|
3344
3525
|
}
|
|
3345
3526
|
),
|
|
@@ -3416,10 +3597,10 @@ const PageFooter = ({
|
|
|
3416
3597
|
ContentEditable,
|
|
3417
3598
|
{
|
|
3418
3599
|
ref: contentRef,
|
|
3419
|
-
className: `outline-none p-2 text-
|
|
3600
|
+
className: `outline-none p-2 text-gray-600 min-h-[24px] ${hasPageCounter ? "pr-24" : ""}`
|
|
3420
3601
|
}
|
|
3421
3602
|
),
|
|
3422
|
-
placeholder: /* @__PURE__ */ jsx("div", { className: `absolute top-0 left-0 text-gray-400 pointer-events-none select-none p-2
|
|
3603
|
+
placeholder: /* @__PURE__ */ jsx("div", { className: `absolute top-0 left-0 text-gray-400 pointer-events-none select-none p-2 ${hasPageCounter ? "pr-24" : ""}`, children: t.footer.placeholder }),
|
|
3423
3604
|
ErrorBoundary: LexicalErrorBoundary
|
|
3424
3605
|
}
|
|
3425
3606
|
),
|
|
@@ -4352,6 +4533,36 @@ function astExtension() {
|
|
|
4352
4533
|
}
|
|
4353
4534
|
};
|
|
4354
4535
|
}
|
|
4536
|
+
const EMPTY_CONTEXT = {
|
|
4537
|
+
definitions: [],
|
|
4538
|
+
refreshDefinitions: () => {
|
|
4539
|
+
},
|
|
4540
|
+
getDefinition: () => void 0
|
|
4541
|
+
};
|
|
4542
|
+
const VariableContext = createContext(EMPTY_CONTEXT);
|
|
4543
|
+
const VariableProvider = ({
|
|
4544
|
+
initialDefinitions = [],
|
|
4545
|
+
children
|
|
4546
|
+
}) => {
|
|
4547
|
+
const [definitions, setDefinitions] = useState(initialDefinitions);
|
|
4548
|
+
const refresh = useCallback((newDefinitions) => {
|
|
4549
|
+
setDefinitions(newDefinitions);
|
|
4550
|
+
}, []);
|
|
4551
|
+
const getDefinition = useCallback(
|
|
4552
|
+
(key) => {
|
|
4553
|
+
return definitions.find((d) => d.key === key);
|
|
4554
|
+
},
|
|
4555
|
+
[definitions]
|
|
4556
|
+
);
|
|
4557
|
+
const value = useMemo(
|
|
4558
|
+
() => ({ definitions, refreshDefinitions: refresh, getDefinition }),
|
|
4559
|
+
[definitions, refresh, getDefinition]
|
|
4560
|
+
);
|
|
4561
|
+
return /* @__PURE__ */ jsx(VariableContext.Provider, { value, children });
|
|
4562
|
+
};
|
|
4563
|
+
function useVariables() {
|
|
4564
|
+
return useContext(VariableContext);
|
|
4565
|
+
}
|
|
4355
4566
|
class VariableNode extends DecoratorNode {
|
|
4356
4567
|
constructor(variableKey, key) {
|
|
4357
4568
|
super(key);
|
|
@@ -4411,17 +4622,23 @@ class VariableNode extends DecoratorNode {
|
|
|
4411
4622
|
}
|
|
4412
4623
|
// -- Rendering --
|
|
4413
4624
|
decorate() {
|
|
4414
|
-
return /* @__PURE__ */ jsx(
|
|
4415
|
-
"span",
|
|
4416
|
-
{
|
|
4417
|
-
className: "lex4-variable-chip inline-flex items-center rounded bg-white px-1.5 py-0.5\n text-xs font-medium text-blue-700 border border-blue-300 select-none\n cursor-default whitespace-nowrap mx-0.5",
|
|
4418
|
-
"data-testid": `variable-chip-${this.__variableKey}`,
|
|
4419
|
-
title: this.__variableKey,
|
|
4420
|
-
children: `{{${this.__variableKey}}}`
|
|
4421
|
-
}
|
|
4422
|
-
);
|
|
4625
|
+
return /* @__PURE__ */ jsx(VariableChip, { variableKey: this.__variableKey });
|
|
4423
4626
|
}
|
|
4424
4627
|
}
|
|
4628
|
+
function VariableChip({ variableKey }) {
|
|
4629
|
+
var _a;
|
|
4630
|
+
const { getDefinition } = useVariables();
|
|
4631
|
+
const label = ((_a = getDefinition(variableKey)) == null ? void 0 : _a.label) ?? variableKey;
|
|
4632
|
+
return /* @__PURE__ */ jsx(
|
|
4633
|
+
"span",
|
|
4634
|
+
{
|
|
4635
|
+
className: "lex4-variable-chip inline-flex items-center rounded-full border border-blue-300\n bg-white px-2 py-0.5 text-[11px] font-medium text-blue-700 select-none\n cursor-default whitespace-nowrap mx-0.5",
|
|
4636
|
+
"data-testid": `variable-chip-${variableKey}`,
|
|
4637
|
+
title: variableKey,
|
|
4638
|
+
children: label
|
|
4639
|
+
}
|
|
4640
|
+
);
|
|
4641
|
+
}
|
|
4425
4642
|
function $createVariableNode(variableKey) {
|
|
4426
4643
|
return $applyNodeReplacement(new VariableNode(variableKey));
|
|
4427
4644
|
}
|
|
@@ -4448,36 +4665,6 @@ const VariablePlugin = () => {
|
|
|
4448
4665
|
}, [editor]);
|
|
4449
4666
|
return null;
|
|
4450
4667
|
};
|
|
4451
|
-
const EMPTY_CONTEXT = {
|
|
4452
|
-
definitions: [],
|
|
4453
|
-
refreshDefinitions: () => {
|
|
4454
|
-
},
|
|
4455
|
-
getDefinition: () => void 0
|
|
4456
|
-
};
|
|
4457
|
-
const VariableContext = createContext(EMPTY_CONTEXT);
|
|
4458
|
-
const VariableProvider = ({
|
|
4459
|
-
initialDefinitions = [],
|
|
4460
|
-
children
|
|
4461
|
-
}) => {
|
|
4462
|
-
const [definitions, setDefinitions] = useState(initialDefinitions);
|
|
4463
|
-
const refresh = useCallback((newDefinitions) => {
|
|
4464
|
-
setDefinitions(newDefinitions);
|
|
4465
|
-
}, []);
|
|
4466
|
-
const getDefinition = useCallback(
|
|
4467
|
-
(key) => {
|
|
4468
|
-
return definitions.find((d) => d.key === key);
|
|
4469
|
-
},
|
|
4470
|
-
[definitions]
|
|
4471
|
-
);
|
|
4472
|
-
const value = useMemo(
|
|
4473
|
-
() => ({ definitions, refreshDefinitions: refresh, getDefinition }),
|
|
4474
|
-
[definitions, refresh, getDefinition]
|
|
4475
|
-
);
|
|
4476
|
-
return /* @__PURE__ */ jsx(VariableContext.Provider, { value, children });
|
|
4477
|
-
};
|
|
4478
|
-
function useVariables() {
|
|
4479
|
-
return useContext(VariableContext);
|
|
4480
|
-
}
|
|
4481
4668
|
const VariablePicker = ({ onInsert, disabled = false }) => {
|
|
4482
4669
|
const { definitions } = useVariables();
|
|
4483
4670
|
const [open, setOpen] = useState(false);
|
|
@@ -4771,6 +4958,7 @@ export {
|
|
|
4771
4958
|
Lex4Editor,
|
|
4772
4959
|
MAX_FOOTER_HEIGHT_PX,
|
|
4773
4960
|
MAX_HEADER_HEIGHT_PX,
|
|
4961
|
+
PT_BR_TRANSLATIONS,
|
|
4774
4962
|
VariableNode,
|
|
4775
4963
|
astExtension,
|
|
4776
4964
|
buildSavePayload,
|