@atlaskit/editor-plugin-local-id 9.0.15 → 9.0.16

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-plugin-local-id
2
2
 
3
+ ## 9.0.16
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 9.0.15
4
10
 
5
11
  ### Patch Changes
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/local-id-plugin.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/local-id-plugin.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/local-id-plugin.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/local-id-plugin.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/local-id-plugin.d.ts"
15
8
  }
@@ -4,12 +4,5 @@
4
4
  "module": "../dist/esm/entry-points/local-id-plugin-type.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/local-id-plugin-type.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/local-id-plugin-type.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../dist/types-ts4.5/entry-points/local-id-plugin-type.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../dist/types/entry-points/local-id-plugin-type.d.ts"
15
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-local-id",
3
- "version": "9.0.15",
3
+ "version": "9.0.16",
4
4
  "description": "LocalId plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,7 +34,7 @@
34
34
  "@atlaskit/editor-plugin-limited-mode": "^8.0.0",
35
35
  "@atlaskit/editor-prosemirror": "^7.3.0",
36
36
  "@atlaskit/platform-feature-flags": "^1.1.0",
37
- "@atlaskit/tmp-editor-statsig": "^102.0.0",
37
+ "@atlaskit/tmp-editor-statsig": "^103.0.0",
38
38
  "@babel/runtime": "^7.0.0",
39
39
  "raf-schd": "^4.0.3"
40
40
  },
@@ -4,12 +4,5 @@
4
4
  "module": "../../dist/esm/entry-points/generate-short-uuid.js",
5
5
  "module:es2019": "../../dist/es2019/entry-points/generate-short-uuid.js",
6
6
  "sideEffects": false,
7
- "types": "../../dist/types/entry-points/generate-short-uuid.d.ts",
8
- "typesVersions": {
9
- ">=4.5 <5.9": {
10
- "*": [
11
- "../../dist/types-ts4.5/entry-points/generate-short-uuid.d.ts"
12
- ]
13
- }
14
- }
7
+ "types": "../../dist/types/entry-points/generate-short-uuid.d.ts"
15
8
  }
@@ -1,12 +0,0 @@
1
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import type { Node } from '@atlaskit/editor-prosemirror/model';
3
- import type { Transform } from '@atlaskit/editor-prosemirror/transform';
4
- import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
5
- import type { ActionProps, LocalIdPlugin } from '../localIdPluginType';
6
- type EditorActionProps = ActionProps;
7
- export declare function findNodeByLocalId(tr: Transform, localId: string): NodeWithPos | undefined;
8
- export declare const replaceNode: (api: ExtractInjectionAPI<LocalIdPlugin> | undefined) => ({ localId, value }: EditorActionProps & {
9
- value: Node;
10
- }) => boolean;
11
- export declare const getNode: (api: ExtractInjectionAPI<LocalIdPlugin> | undefined) => ({ localId }: EditorActionProps) => NodeWithPos | undefined;
12
- export {};
@@ -1 +0,0 @@
1
- export { generateShortUUID, generatedShortUUIDs } from '../pm-plugins/generateShortUUID';
@@ -1 +0,0 @@
1
- export type { LocalIdPlugin } from '../localIdPluginType';
@@ -1 +0,0 @@
1
- export { localIdPlugin } from '../localIdPlugin';
@@ -1,2 +0,0 @@
1
- export { localIdPlugin } from './localIdPlugin';
2
- export type { LocalIdPlugin } from './localIdPluginType';
@@ -1,2 +0,0 @@
1
- import type { LocalIdPlugin } from './localIdPluginType';
2
- export declare const localIdPlugin: LocalIdPlugin;
@@ -1,41 +0,0 @@
1
- import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
- import type { CollabEditPlugin } from '@atlaskit/editor-plugin-collab-edit';
3
- import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition';
4
- import type { LimitedModePlugin } from '@atlaskit/editor-plugin-limited-mode';
5
- import type { Node } from '@atlaskit/editor-prosemirror/model';
6
- import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
7
- export type ActionProps = {
8
- localId: string;
9
- };
10
- export type LocalIdStatusCode = 'current' | 'localChangeByAttr' | 'localChangeBySetAttrs' | 'localChangeByBatchAttrs' | 'localChangeByReplace' | 'localChangeByDelete' | 'localChangeByReplaceAround' | 'localChangeByUnknown' | 'remoteChangeByAttr' | 'remoteChangeBySetAttrs' | 'remoteChangeByBatchAttrs' | 'remoteChangeByReplace' | 'remoteChangeByDelete' | 'remoteChangeByReplaceAround' | 'remoteChangeByUnknown' | 'AIChangeByAttr' | 'AIChangeBySetAttrs' | 'AIChangeByBatchAttrs' | 'AIChangeByReplace' | 'AIChangeByDelete' | 'AIChangeByReplaceAround' | 'AIChangeByUnknown' | 'docChangeByAttr' | 'docChangeBySetAttrs' | 'docChangeByBatchAttrs' | 'docChangeByReplace' | 'docChangeByDelete' | 'docChangeByReplaceAround' | 'docChangeByUnknown';
11
- export interface LocalIdSharedState {
12
- localIdStatus: Map<string, LocalIdStatusCode> | undefined;
13
- localIdWatchmenEnabled: boolean | undefined;
14
- }
15
- export type LocalIdPlugin = NextEditorPlugin<'localId', {
16
- actions: {
17
- /**
18
- * Get the node with its position in the document
19
- *
20
- * @param props.localId Local id of the node in question
21
- * @returns { node: ProsemirrorNode, pos: number } Object containing prosemirror node and position in the document
22
- */
23
- getNode: (props: ActionProps) => NodeWithPos | undefined;
24
- /**
25
- * Replace the node in the document by its local id
26
- *
27
- * @param props.localId Local id of the node in question
28
- * @param props.value Prosemirror node to replace the node with
29
- * @returns boolean if the replace was successful
30
- */
31
- replaceNode: (props: ActionProps & {
32
- value: Node;
33
- }) => boolean;
34
- };
35
- dependencies: [
36
- CompositionPlugin,
37
- OptionalPlugin<CollabEditPlugin>,
38
- OptionalPlugin<LimitedModePlugin>
39
- ];
40
- sharedState: LocalIdSharedState | undefined;
41
- }>;
@@ -1,12 +0,0 @@
1
- /**
2
- * Global Set to track currently generated and existing short UUIDs in the document.
3
- * Used to prevent duplicate short IDs when using crypto.randomUUID().
4
- */
5
- export declare const generatedShortUUIDs: Set<string>;
6
- /**
7
- * Generates a short UUID and checks for duplicates against both
8
- * generated UUIDs and existing UUIDs in the document.
9
- * Retries up to 10 times if a duplicate is found.
10
- * Falls back to full UUID if max retries exceeded.
11
- */
12
- export declare const generateShortUUID: () => string;
@@ -1,12 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import { PluginKey, type Transaction } from '@atlaskit/editor-prosemirror/state';
4
- import type { LocalIdPlugin } from '../localIdPluginType';
5
- export declare const localIdPluginKey: PluginKey;
6
- export declare const createPlugin: (api: ExtractInjectionAPI<LocalIdPlugin> | undefined) => SafePlugin;
7
- /**
8
- * Batch adds local IDs to nodes using a BatchAttrsStep
9
- * @param nodesToUpdate Map of position -> localId for nodes that need updates
10
- * @param tr
11
- */
12
- export declare const batchAddLocalIdToNodes: (nodesToUpdate: Map<number, string>, tr: Transaction) => void;
@@ -1,32 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
- import type { LocalIdPlugin, LocalIdStatusCode } from '../localIdPluginType';
5
- /**
6
- * Plugin state tracking all localIds in the document
7
- */
8
- export type LocalIdWatchmenState = {
9
- /**
10
- * This flag controls whether or not the watchmen plugin will process transactions. Caution! disabling and then re-enabling
11
- * this plugin will cause the watchment to rescan the whole document to sync the localId state.
12
- */
13
- enabled: boolean;
14
- /**
15
- * This is the initial count of localIds when the plugin was first initialized.
16
- */
17
- initLocalIdSize: number;
18
- /**
19
- * Timestamp of last state update for debugging
20
- */
21
- lastUpdated: number;
22
- /**
23
- * This is a list of all localIds which have ever existed in the document and whether or not they're currently
24
- * on the page (ie "active") or not.
25
- */
26
- localIdStatus: Map<string, LocalIdStatusCode>;
27
- };
28
- export declare const localIdWatchmenPluginKey: PluginKey<LocalIdWatchmenState>;
29
- /**
30
- * Creates the localId watchmen plugin
31
- */
32
- export declare const createWatchmenPlugin: (api: ExtractInjectionAPI<LocalIdPlugin> | undefined) => SafePlugin<LocalIdWatchmenState>;