@atlaskit/editor-core 193.10.4 → 193.10.7
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 +24 -0
- package/dist/cjs/actions/index.js +13 -3
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/actions/index.js +10 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/actions/index.js +13 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/actions/index.d.ts +10 -0
- package/dist/types/create-editor/create-preset.d.ts +140 -48
- package/dist/types/presets/default.d.ts +96 -92
- package/dist/types/presets/universal.d.ts +140 -48
- package/dist/types/presets/useUniversalPreset.d.ts +140 -48
- package/dist/types-ts4.5/actions/index.d.ts +10 -0
- package/dist/types-ts4.5/create-editor/create-preset.d.ts +161 -53
- package/dist/types-ts4.5/presets/default.d.ts +110 -106
- package/dist/types-ts4.5/presets/universal.d.ts +161 -53
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +161 -53
- package/docs/0-intro.tsx +87 -0
- package/package.json +18 -10
|
@@ -169,6 +169,58 @@ export default function useUniversalPreset({ props }: PresetProps): import("@atl
|
|
|
169
169
|
];
|
|
170
170
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
171
171
|
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
|
|
172
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"editorViewMode", {
|
|
173
|
+
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
174
|
+
dependencies: [
|
|
175
|
+
import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"collabEdit", {
|
|
176
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
|
|
177
|
+
dependencies: [
|
|
178
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"featureFlags", {
|
|
179
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
180
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
181
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>>,
|
|
182
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"analytics", {
|
|
183
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
184
|
+
sharedState: {
|
|
185
|
+
createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
|
|
186
|
+
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
187
|
+
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
188
|
+
};
|
|
189
|
+
dependencies: [
|
|
190
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"featureFlags", {
|
|
191
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
192
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
193
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
194
|
+
];
|
|
195
|
+
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
196
|
+
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
|
|
197
|
+
];
|
|
198
|
+
sharedState: import("@atlaskit/editor-plugin-collab-edit").CollabEditPluginSharedState;
|
|
199
|
+
actions: {
|
|
200
|
+
getAvatarColor: (str: string) => {
|
|
201
|
+
index: number;
|
|
202
|
+
color: import("@atlaskit/editor-common/collab").Color;
|
|
203
|
+
};
|
|
204
|
+
addInlineCommentMark: (props: {
|
|
205
|
+
from: number;
|
|
206
|
+
to: number;
|
|
207
|
+
mark: import("prosemirror-model").Mark;
|
|
208
|
+
}) => boolean;
|
|
209
|
+
};
|
|
210
|
+
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
|
|
211
|
+
];
|
|
212
|
+
pluginConfiguration?: {
|
|
213
|
+
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
214
|
+
} | undefined;
|
|
215
|
+
commands: {
|
|
216
|
+
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
217
|
+
};
|
|
218
|
+
actions: {
|
|
219
|
+
applyViewModeStepAt: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
220
|
+
};
|
|
221
|
+
}, {
|
|
222
|
+
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
223
|
+
} | undefined>>,
|
|
172
224
|
import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"width", {
|
|
173
225
|
sharedState: import("@atlaskit/editor-plugin-width").WidthPluginState | undefined;
|
|
174
226
|
}, undefined>,
|
|
@@ -372,6 +424,7 @@ export default function useUniversalPreset({ props }: PresetProps): import("@atl
|
|
|
372
424
|
];
|
|
373
425
|
actions: {
|
|
374
426
|
prependToolbarButtons: import("@atlaskit/editor-plugin-hyperlink").PrependToolbarButtons;
|
|
427
|
+
addToolbarItems: import("@atlaskit/editor-plugin-hyperlink").AddToolbarItems;
|
|
375
428
|
hideLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").HideLinkToolbar;
|
|
376
429
|
insertLink: import("@atlaskit/editor-plugin-hyperlink").InsertLink;
|
|
377
430
|
updateLink: import("@atlaskit/editor-plugin-hyperlink").UpdateLink;
|
|
@@ -1287,6 +1340,58 @@ export default function useUniversalPreset({ props }: PresetProps): import("@atl
|
|
|
1287
1340
|
];
|
|
1288
1341
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
1289
1342
|
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
|
|
1343
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"editorViewMode", {
|
|
1344
|
+
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
1345
|
+
dependencies: [
|
|
1346
|
+
import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"collabEdit", {
|
|
1347
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
|
|
1348
|
+
dependencies: [
|
|
1349
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"featureFlags", {
|
|
1350
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
1351
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
1352
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>>,
|
|
1353
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"analytics", {
|
|
1354
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
1355
|
+
sharedState: {
|
|
1356
|
+
createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
|
|
1357
|
+
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
1358
|
+
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
1359
|
+
};
|
|
1360
|
+
dependencies: [
|
|
1361
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"featureFlags", {
|
|
1362
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
1363
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
1364
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
1365
|
+
];
|
|
1366
|
+
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
1367
|
+
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
|
|
1368
|
+
];
|
|
1369
|
+
sharedState: import("@atlaskit/editor-plugin-collab-edit").CollabEditPluginSharedState;
|
|
1370
|
+
actions: {
|
|
1371
|
+
getAvatarColor: (str: string) => {
|
|
1372
|
+
index: number;
|
|
1373
|
+
color: import("@atlaskit/editor-common/collab").Color;
|
|
1374
|
+
};
|
|
1375
|
+
addInlineCommentMark: (props: {
|
|
1376
|
+
from: number;
|
|
1377
|
+
to: number;
|
|
1378
|
+
mark: import("prosemirror-model").Mark;
|
|
1379
|
+
}) => boolean;
|
|
1380
|
+
};
|
|
1381
|
+
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
|
|
1382
|
+
];
|
|
1383
|
+
pluginConfiguration?: {
|
|
1384
|
+
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
1385
|
+
} | undefined;
|
|
1386
|
+
commands: {
|
|
1387
|
+
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
1388
|
+
};
|
|
1389
|
+
actions: {
|
|
1390
|
+
applyViewModeStepAt: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
1391
|
+
};
|
|
1392
|
+
}, {
|
|
1393
|
+
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
1394
|
+
} | undefined>>,
|
|
1290
1395
|
import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"width", {
|
|
1291
1396
|
sharedState: import("@atlaskit/editor-plugin-width").WidthPluginState | undefined;
|
|
1292
1397
|
}, undefined>,
|
|
@@ -1490,6 +1595,7 @@ export default function useUniversalPreset({ props }: PresetProps): import("@atl
|
|
|
1490
1595
|
];
|
|
1491
1596
|
actions: {
|
|
1492
1597
|
prependToolbarButtons: import("@atlaskit/editor-plugin-hyperlink").PrependToolbarButtons;
|
|
1598
|
+
addToolbarItems: import("@atlaskit/editor-plugin-hyperlink").AddToolbarItems;
|
|
1493
1599
|
hideLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").HideLinkToolbar;
|
|
1494
1600
|
insertLink: import("@atlaskit/editor-plugin-hyperlink").InsertLink;
|
|
1495
1601
|
updateLink: import("@atlaskit/editor-plugin-hyperlink").UpdateLink;
|
|
@@ -3449,59 +3555,7 @@ export default function useUniversalPreset({ props }: PresetProps): import("@atl
|
|
|
3449
3555
|
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
3450
3556
|
];
|
|
3451
3557
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
3452
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions
|
|
3453
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"editorViewMode", {
|
|
3454
|
-
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
3455
|
-
dependencies: [
|
|
3456
|
-
import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"collabEdit", {
|
|
3457
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
|
|
3458
|
-
dependencies: [
|
|
3459
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"featureFlags", {
|
|
3460
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
3461
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
3462
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>,
|
|
3463
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"analytics", {
|
|
3464
|
-
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
3465
|
-
sharedState: {
|
|
3466
|
-
createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
|
|
3467
|
-
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
3468
|
-
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
3469
|
-
};
|
|
3470
|
-
dependencies: [
|
|
3471
|
-
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"featureFlags", {
|
|
3472
|
-
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
3473
|
-
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
3474
|
-
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
3475
|
-
];
|
|
3476
|
-
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
3477
|
-
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
|
|
3478
|
-
];
|
|
3479
|
-
sharedState: import("@atlaskit/editor-plugin-collab-edit").CollabEditPluginSharedState;
|
|
3480
|
-
actions: {
|
|
3481
|
-
getAvatarColor: (str: string) => {
|
|
3482
|
-
index: number;
|
|
3483
|
-
color: import("@atlaskit/editor-common/collab").Color;
|
|
3484
|
-
};
|
|
3485
|
-
addInlineCommentMark: (props: {
|
|
3486
|
-
from: number;
|
|
3487
|
-
to: number;
|
|
3488
|
-
mark: import("prosemirror-model").Mark;
|
|
3489
|
-
}) => boolean;
|
|
3490
|
-
};
|
|
3491
|
-
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
|
|
3492
|
-
];
|
|
3493
|
-
pluginConfiguration?: {
|
|
3494
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
3495
|
-
} | undefined;
|
|
3496
|
-
commands: {
|
|
3497
|
-
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
3498
|
-
};
|
|
3499
|
-
actions: {
|
|
3500
|
-
applyViewModeStepAt: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
3501
|
-
};
|
|
3502
|
-
}, {
|
|
3503
|
-
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
3504
|
-
} | undefined>>
|
|
3558
|
+
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
|
|
3505
3559
|
];
|
|
3506
3560
|
actions: {
|
|
3507
3561
|
insertCodeBlock: (inputMethod: import("@atlaskit/editor-common/analytics").INPUT_METHOD) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -4251,6 +4305,7 @@ export default function useUniversalPreset({ props }: PresetProps): import("@atl
|
|
|
4251
4305
|
];
|
|
4252
4306
|
actions: {
|
|
4253
4307
|
prependToolbarButtons: import("@atlaskit/editor-plugin-hyperlink").PrependToolbarButtons;
|
|
4308
|
+
addToolbarItems: import("@atlaskit/editor-plugin-hyperlink").AddToolbarItems;
|
|
4254
4309
|
hideLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").HideLinkToolbar;
|
|
4255
4310
|
insertLink: import("@atlaskit/editor-plugin-hyperlink").InsertLink;
|
|
4256
4311
|
updateLink: import("@atlaskit/editor-plugin-hyperlink").UpdateLink;
|
|
@@ -4562,6 +4617,58 @@ export default function useUniversalPreset({ props }: PresetProps): import("@atl
|
|
|
4562
4617
|
];
|
|
4563
4618
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
4564
4619
|
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>,
|
|
4620
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"editorViewMode", {
|
|
4621
|
+
sharedState: import("@atlaskit/editor-plugin-editor-viewmode").EditorViewModePluginState | null;
|
|
4622
|
+
dependencies: [
|
|
4623
|
+
import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"collabEdit", {
|
|
4624
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions;
|
|
4625
|
+
dependencies: [
|
|
4626
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"featureFlags", {
|
|
4627
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
4628
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
4629
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>>,
|
|
4630
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"analytics", {
|
|
4631
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
4632
|
+
sharedState: {
|
|
4633
|
+
createAnalyticsEvent: import("@atlaskit/analytics-next").CreateUIAnalyticsEvent | null;
|
|
4634
|
+
attachAnalyticsEvent: import("@atlaskit/editor-plugin-analytics").CreateAttachPayloadIntoTransaction | null;
|
|
4635
|
+
performanceTracking: import("@atlaskit/editor-common/types").PerformanceTracking | undefined;
|
|
4636
|
+
};
|
|
4637
|
+
dependencies: [
|
|
4638
|
+
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"featureFlags", {
|
|
4639
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
4640
|
+
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
4641
|
+
}, import("@atlaskit/editor-common/types").FeatureFlags>>
|
|
4642
|
+
];
|
|
4643
|
+
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
4644
|
+
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
|
|
4645
|
+
];
|
|
4646
|
+
sharedState: import("@atlaskit/editor-plugin-collab-edit").CollabEditPluginSharedState;
|
|
4647
|
+
actions: {
|
|
4648
|
+
getAvatarColor: (str: string) => {
|
|
4649
|
+
index: number;
|
|
4650
|
+
color: import("@atlaskit/editor-common/collab").Color;
|
|
4651
|
+
};
|
|
4652
|
+
addInlineCommentMark: (props: {
|
|
4653
|
+
from: number;
|
|
4654
|
+
to: number;
|
|
4655
|
+
mark: import("prosemirror-model").Mark;
|
|
4656
|
+
}) => boolean;
|
|
4657
|
+
};
|
|
4658
|
+
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
|
|
4659
|
+
];
|
|
4660
|
+
pluginConfiguration?: {
|
|
4661
|
+
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
4662
|
+
} | undefined;
|
|
4663
|
+
commands: {
|
|
4664
|
+
updateViewMode: (mode: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
4665
|
+
};
|
|
4666
|
+
actions: {
|
|
4667
|
+
applyViewModeStepAt: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
4668
|
+
};
|
|
4669
|
+
}, {
|
|
4670
|
+
mode?: import("@atlaskit/editor-plugin-editor-viewmode").ViewMode | undefined;
|
|
4671
|
+
} | undefined>>,
|
|
4565
4672
|
import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"width", {
|
|
4566
4673
|
sharedState: import("@atlaskit/editor-plugin-width").WidthPluginState | undefined;
|
|
4567
4674
|
}, undefined>,
|
|
@@ -4765,6 +4872,7 @@ export default function useUniversalPreset({ props }: PresetProps): import("@atl
|
|
|
4765
4872
|
];
|
|
4766
4873
|
actions: {
|
|
4767
4874
|
prependToolbarButtons: import("@atlaskit/editor-plugin-hyperlink").PrependToolbarButtons;
|
|
4875
|
+
addToolbarItems: import("@atlaskit/editor-plugin-hyperlink").AddToolbarItems;
|
|
4768
4876
|
hideLinkToolbar: import("@atlaskit/editor-plugin-hyperlink").HideLinkToolbar;
|
|
4769
4877
|
insertLink: import("@atlaskit/editor-plugin-hyperlink").InsertLink;
|
|
4770
4878
|
updateLink: import("@atlaskit/editor-plugin-hyperlink").UpdateLink;
|
package/docs/0-intro.tsx
CHANGED
|
@@ -305,6 +305,93 @@ const CommentEditorWithMentions = () => {
|
|
|
305
305
|
};
|
|
306
306
|
`}
|
|
307
307
|
|
|
308
|
+
## Getting the editor value
|
|
309
|
+
|
|
310
|
+
The \`core\` API on the \`editorApi\` can be used to request the document of the editor.
|
|
311
|
+
|
|
312
|
+
Here is an example of a simple editor requesting the document when the content changes:
|
|
313
|
+
|
|
314
|
+
${code`
|
|
315
|
+
import { ComposableEditor } from '@atlaskit/editor-core/composable-editor';
|
|
316
|
+
import { EditorContext } from '@atlaskit/editor-core/editor-context';
|
|
317
|
+
import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
318
|
+
import { usePreset } from '@atlaskit/editor-core/use-preset';
|
|
319
|
+
import { basePlugin } from '@atlaskit/editor-plugins/base';
|
|
320
|
+
import { blockTypePlugin } from '@atlaskit/editor-plugins/block-type';
|
|
321
|
+
import { listPlugin } from '@atlaskit/editor-plugins/list';
|
|
322
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugins/analytics';
|
|
323
|
+
|
|
324
|
+
const createPreset = () =>
|
|
325
|
+
new EditorPresetBuilder()
|
|
326
|
+
.add(basePlugin)
|
|
327
|
+
.add(analyticsPlugin)
|
|
328
|
+
.add(blockTypePlugin)
|
|
329
|
+
.add(listPlugin)
|
|
330
|
+
|
|
331
|
+
function EditorInternal() {
|
|
332
|
+
const { editorApi, preset } = usePreset(createPreset);
|
|
333
|
+
return (
|
|
334
|
+
<ComposableEditor
|
|
335
|
+
preset={preset}
|
|
336
|
+
onChange={() => {
|
|
337
|
+
editorApi?.core?.actions.requestDocument(doc => {
|
|
338
|
+
// Use the document as you require
|
|
339
|
+
})
|
|
340
|
+
}}
|
|
341
|
+
/>
|
|
342
|
+
);
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
export function Editor() {
|
|
346
|
+
return (
|
|
347
|
+
<EditorContext
|
|
348
|
+
<Editor />
|
|
349
|
+
</EditorContext>
|
|
350
|
+
);
|
|
351
|
+
};
|
|
352
|
+
`}
|
|
353
|
+
|
|
354
|
+
#### When does the document return?
|
|
355
|
+
|
|
356
|
+
For performance reasons we throttle calls to \`requestDocument\` and will return the document when there is idle time.
|
|
357
|
+
|
|
358
|
+
There is a timeout however which will start the document request to ensure the callback doesn't take seconds to fire.
|
|
359
|
+
|
|
360
|
+
### Transforming the value
|
|
361
|
+
|
|
362
|
+
By default the requested document is returned as \`JSONDocNode\` (see \`@atlaskit/editor-json-transformer\`).
|
|
363
|
+
|
|
364
|
+
However, oftentimes you may want the document in a different format. The \`core\` API also provides a method to
|
|
365
|
+
create a transformer based on a schema.
|
|
366
|
+
|
|
367
|
+
The \`requestDocument\` callback will be typed appropriately based on the transformer passed to it.
|
|
368
|
+
|
|
369
|
+
Example using the \`BitbucketTransformer\` (which transforms to markdown):
|
|
370
|
+
|
|
371
|
+
${code`
|
|
372
|
+
|
|
373
|
+
function EditorInternal() {
|
|
374
|
+
const { editorApi, preset } = usePreset(createPreset);
|
|
375
|
+
|
|
376
|
+
// We memoise the transformer in case this component renders frequently
|
|
377
|
+
const transformer = useMemo(() =>
|
|
378
|
+
editorApi?.core?.actions?.createTransformer((schema) => new BitbucketTransformer(schema))
|
|
379
|
+
, [editorApi])
|
|
380
|
+
|
|
381
|
+
return (
|
|
382
|
+
<ComposableEditor
|
|
383
|
+
preset={preset}
|
|
384
|
+
onChange={() => {
|
|
385
|
+
editorApi?.core?.actions.requestDocument(doc => {
|
|
386
|
+
// Use the document as you require - it will be typed as "string | undefined" due to the transformer type
|
|
387
|
+
}, { transformer })
|
|
388
|
+
}}
|
|
389
|
+
/>
|
|
390
|
+
);
|
|
391
|
+
};
|
|
392
|
+
`}
|
|
393
|
+
|
|
394
|
+
|
|
308
395
|
${(
|
|
309
396
|
<Example
|
|
310
397
|
packageName="@atlaskit/editor-core/composable-editor"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "193.10.
|
|
3
|
+
"version": "193.10.7",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@atlaskit/activity-provider": "^2.4.0",
|
|
43
|
-
"@atlaskit/adf-schema": "^35.
|
|
43
|
+
"@atlaskit/adf-schema": "^35.9.0",
|
|
44
44
|
"@atlaskit/analytics-namespaced-context": "^6.9.0",
|
|
45
45
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
46
46
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
47
47
|
"@atlaskit/button": "^17.12.0",
|
|
48
|
-
"@atlaskit/editor-common": "^78.
|
|
48
|
+
"@atlaskit/editor-common": "^78.28.0",
|
|
49
49
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
50
|
-
"@atlaskit/editor-plugins": "^2.
|
|
50
|
+
"@atlaskit/editor-plugins": "^2.2.0",
|
|
51
51
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
52
52
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
53
53
|
"@atlaskit/emoji": "^67.6.0",
|
|
@@ -87,10 +87,10 @@
|
|
|
87
87
|
"@atlaskit/adf-utils": "^19.0.0",
|
|
88
88
|
"@atlaskit/analytics-listeners": "^8.9.1",
|
|
89
89
|
"@atlaskit/checkbox": "^13.1.0",
|
|
90
|
-
"@atlaskit/collab-provider": "9.26.
|
|
90
|
+
"@atlaskit/collab-provider": "9.26.1",
|
|
91
91
|
"@atlaskit/dropdown-menu": "^12.8.0",
|
|
92
|
-
"@atlaskit/editor-plugin-annotation": "1.5.
|
|
93
|
-
"@atlaskit/editor-plugin-card": "^1.
|
|
92
|
+
"@atlaskit/editor-plugin-annotation": "1.5.9",
|
|
93
|
+
"@atlaskit/editor-plugin-card": "^1.8.0",
|
|
94
94
|
"@atlaskit/editor-plugin-editor-viewmode": "^1.0.0",
|
|
95
95
|
"@atlaskit/editor-plugin-list": "^3.1.5",
|
|
96
96
|
"@atlaskit/editor-plugin-paste": "^1.0.0",
|
|
@@ -104,16 +104,16 @@
|
|
|
104
104
|
"@atlaskit/media-test-helpers": "^33.0.27",
|
|
105
105
|
"@atlaskit/modal-dialog": "^12.10.0",
|
|
106
106
|
"@atlaskit/primitives": "^5.5.0",
|
|
107
|
-
"@atlaskit/renderer": "^109.
|
|
107
|
+
"@atlaskit/renderer": "^109.18.0",
|
|
108
108
|
"@atlaskit/select": "^17.6.0",
|
|
109
|
-
"@atlaskit/smart-card": "^26.
|
|
109
|
+
"@atlaskit/smart-card": "^26.56.0",
|
|
110
110
|
"@atlaskit/synchrony-test-helpers": "^2.3.0",
|
|
111
111
|
"@atlaskit/util-data-test": "^17.9.0",
|
|
112
112
|
"@atlaskit/visual-regression": "*",
|
|
113
113
|
"@atlassian/adf-schema-json": "^1.0.7",
|
|
114
114
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
115
115
|
"@atlassian/link-picker-plugins": "^24.0.0",
|
|
116
|
-
"@atlassian/search-provider": "2.4.
|
|
116
|
+
"@atlassian/search-provider": "2.4.56",
|
|
117
117
|
"@atlassian/ufo": "^0.2.0",
|
|
118
118
|
"@emotion/jest": "^11.8.0",
|
|
119
119
|
"@storybook/addon-knobs": "^5.3.18",
|
|
@@ -323,6 +323,14 @@
|
|
|
323
323
|
"platform.editor.extractlistfromparagraphv2": {
|
|
324
324
|
"type": "boolean",
|
|
325
325
|
"referenceOnly": "true"
|
|
326
|
+
},
|
|
327
|
+
"platform.editor.card.inject-settings-button": {
|
|
328
|
+
"type": "boolean",
|
|
329
|
+
"referenceOnly": "true"
|
|
330
|
+
},
|
|
331
|
+
"platform.editor.table.colum-resizing-improvements": {
|
|
332
|
+
"type": "boolean",
|
|
333
|
+
"referenceOnly": "true"
|
|
326
334
|
}
|
|
327
335
|
},
|
|
328
336
|
"stricter": {
|