@atlaskit/editor-common 111.35.0 → 112.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/cjs/analytics/types/enums.js +2 -0
  3. package/dist/cjs/extensibility/ExtensionComponent.js +6 -5
  4. package/dist/cjs/extensions/UnknownMacroPlaceholder.compiled.css +28 -0
  5. package/dist/cjs/extensions/UnknownMacroPlaceholder.js +70 -0
  6. package/dist/cjs/extensions/extension-handlers.js +16 -0
  7. package/dist/cjs/extensions/messages.js +10 -0
  8. package/dist/cjs/hooks/index.js +1 -8
  9. package/dist/cjs/monitoring/error.js +1 -1
  10. package/dist/cjs/ncs-step-metrics/index.js +1 -0
  11. package/dist/cjs/preset/core-plugin/index.js +4 -0
  12. package/dist/cjs/styles/shared/table.js +1 -1
  13. package/dist/cjs/ui/DropList/index.js +1 -1
  14. package/dist/es2019/analytics/types/enums.js +2 -0
  15. package/dist/es2019/extensibility/ExtensionComponent.js +6 -5
  16. package/dist/es2019/extensions/UnknownMacroPlaceholder.compiled.css +28 -0
  17. package/dist/es2019/extensions/UnknownMacroPlaceholder.js +46 -0
  18. package/dist/es2019/extensions/extension-handlers.js +16 -0
  19. package/dist/es2019/extensions/messages.js +10 -0
  20. package/dist/es2019/hooks/index.js +1 -2
  21. package/dist/es2019/monitoring/error.js +1 -1
  22. package/dist/es2019/ncs-step-metrics/index.js +1 -0
  23. package/dist/es2019/preset/core-plugin/index.js +4 -0
  24. package/dist/es2019/styles/shared/table.js +1 -1
  25. package/dist/es2019/ui/DropList/index.js +1 -1
  26. package/dist/esm/analytics/types/enums.js +2 -0
  27. package/dist/esm/extensibility/ExtensionComponent.js +6 -5
  28. package/dist/esm/extensions/UnknownMacroPlaceholder.compiled.css +28 -0
  29. package/dist/esm/extensions/UnknownMacroPlaceholder.js +61 -0
  30. package/dist/esm/extensions/extension-handlers.js +16 -0
  31. package/dist/esm/extensions/messages.js +10 -0
  32. package/dist/esm/hooks/index.js +1 -2
  33. package/dist/esm/monitoring/error.js +1 -1
  34. package/dist/esm/ncs-step-metrics/index.js +1 -0
  35. package/dist/esm/preset/core-plugin/index.js +4 -0
  36. package/dist/esm/styles/shared/table.js +1 -1
  37. package/dist/esm/ui/DropList/index.js +1 -1
  38. package/dist/types/analytics/index.d.ts +1 -1
  39. package/dist/types/analytics/types/enums.d.ts +1 -0
  40. package/dist/types/analytics/types/events.d.ts +2 -2
  41. package/dist/types/analytics/types/paste-events.d.ts +6 -1
  42. package/dist/types/experiences/ExperienceCheckDomMutation.d.ts +2 -2
  43. package/dist/types/extensions/UnknownMacroPlaceholder.d.ts +7 -0
  44. package/dist/types/extensions/extension-handlers.d.ts +1 -0
  45. package/dist/types/extensions/messages.d.ts +10 -0
  46. package/dist/types/hooks/index.d.ts +0 -1
  47. package/dist/types-ts4.5/analytics/index.d.ts +1 -1
  48. package/dist/types-ts4.5/analytics/types/enums.d.ts +1 -0
  49. package/dist/types-ts4.5/analytics/types/events.d.ts +2 -2
  50. package/dist/types-ts4.5/analytics/types/paste-events.d.ts +6 -1
  51. package/dist/types-ts4.5/experiences/ExperienceCheckDomMutation.d.ts +2 -2
  52. package/dist/types-ts4.5/extensions/UnknownMacroPlaceholder.d.ts +7 -0
  53. package/dist/types-ts4.5/extensions/extension-handlers.d.ts +1 -0
  54. package/dist/types-ts4.5/extensions/messages.d.ts +10 -0
  55. package/dist/types-ts4.5/hooks/index.d.ts +0 -1
  56. package/package.json +7 -4
  57. package/dist/cjs/hooks/useSmartCardReloadAfterCache.js +0 -54
  58. package/dist/es2019/hooks/useSmartCardReloadAfterCache.js +0 -49
  59. package/dist/esm/hooks/useSmartCardReloadAfterCache.js +0 -49
  60. package/dist/types/hooks/useSmartCardReloadAfterCache.d.ts +0 -16
  61. package/dist/types-ts4.5/hooks/useSmartCardReloadAfterCache.d.ts +0 -16
@@ -1,49 +0,0 @@
1
- import { useEffect, useRef } from 'react';
2
- import { useSmartLinkReload } from '@atlaskit/smart-card/hooks';
3
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
-
5
- /**
6
- * Hook to manage smart card reload behavior when content is loaded from local cache.
7
- *
8
- * Handles:
9
- * - Capturing initial card status on mount (synchronously to avoid race conditions)
10
- * - Tracking URL changes and resetting state
11
- * - Only reloading data that was initially loaded from cache
12
- * - Ensuring reload is called at most once per URL
13
- * - Respecting page SSR state to avoid reloading on server-rendered pages
14
- *
15
- * @param url - The smart card URL
16
- * @param cardStatus - The current card resolution status ('pending', 'resolved', etc)
17
- * @param isPageSSRed - Whether the page was server-side rendered
18
- */
19
- const useSmartCardReloadAfterCache = (url, cardStatus, isPageSSRed) => {
20
- const initialCardStatus = useRef(undefined);
21
- const hasReloaded = useRef(false);
22
- const previousUrl = useRef(url);
23
- const reload = useSmartLinkReload({
24
- url: url || ''
25
- });
26
-
27
- // Reset refs when URL changes (do this before capturing initial status)
28
- if (previousUrl.current !== url) {
29
- initialCardStatus.current = undefined;
30
- hasReloaded.current = false;
31
- previousUrl.current = url;
32
- }
33
-
34
- // Capture initial card status on first render (synchronously)
35
- // This determines if the card was loaded from cache (resolved on mount)
36
- // or if it's being fetched fresh (pending on mount)
37
- if (expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true) && cardStatus && initialCardStatus.current === undefined) {
38
- initialCardStatus.current = cardStatus;
39
- }
40
-
41
- // Reload from cache in the background if needed
42
- useEffect(() => {
43
- if (expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true) && !isPageSSRed && url && initialCardStatus.current === 'resolved' && cardStatus === 'resolved' && !hasReloaded.current) {
44
- hasReloaded.current = true;
45
- reload();
46
- }
47
- }, [isPageSSRed, url, cardStatus, reload]);
48
- };
49
- export default useSmartCardReloadAfterCache;
@@ -1,49 +0,0 @@
1
- import { useEffect, useRef } from 'react';
2
- import { useSmartLinkReload } from '@atlaskit/smart-card/hooks';
3
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
-
5
- /**
6
- * Hook to manage smart card reload behavior when content is loaded from local cache.
7
- *
8
- * Handles:
9
- * - Capturing initial card status on mount (synchronously to avoid race conditions)
10
- * - Tracking URL changes and resetting state
11
- * - Only reloading data that was initially loaded from cache
12
- * - Ensuring reload is called at most once per URL
13
- * - Respecting page SSR state to avoid reloading on server-rendered pages
14
- *
15
- * @param url - The smart card URL
16
- * @param cardStatus - The current card resolution status ('pending', 'resolved', etc)
17
- * @param isPageSSRed - Whether the page was server-side rendered
18
- */
19
- var useSmartCardReloadAfterCache = function useSmartCardReloadAfterCache(url, cardStatus, isPageSSRed) {
20
- var initialCardStatus = useRef(undefined);
21
- var hasReloaded = useRef(false);
22
- var previousUrl = useRef(url);
23
- var reload = useSmartLinkReload({
24
- url: url || ''
25
- });
26
-
27
- // Reset refs when URL changes (do this before capturing initial status)
28
- if (previousUrl.current !== url) {
29
- initialCardStatus.current = undefined;
30
- hasReloaded.current = false;
31
- previousUrl.current = url;
32
- }
33
-
34
- // Capture initial card status on first render (synchronously)
35
- // This determines if the card was loaded from cache (resolved on mount)
36
- // or if it's being fetched fresh (pending on mount)
37
- if (expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true) && cardStatus && initialCardStatus.current === undefined) {
38
- initialCardStatus.current = cardStatus;
39
- }
40
-
41
- // Reload from cache in the background if needed
42
- useEffect(function () {
43
- if (expValEquals('platform_editor_smartlink_local_cache', 'isEnabled', true) && !isPageSSRed && url && initialCardStatus.current === 'resolved' && cardStatus === 'resolved' && !hasReloaded.current) {
44
- hasReloaded.current = true;
45
- reload();
46
- }
47
- }, [isPageSSRed, url, cardStatus, reload]);
48
- };
49
- export default useSmartCardReloadAfterCache;
@@ -1,16 +0,0 @@
1
- /**
2
- * Hook to manage smart card reload behavior when content is loaded from local cache.
3
- *
4
- * Handles:
5
- * - Capturing initial card status on mount (synchronously to avoid race conditions)
6
- * - Tracking URL changes and resetting state
7
- * - Only reloading data that was initially loaded from cache
8
- * - Ensuring reload is called at most once per URL
9
- * - Respecting page SSR state to avoid reloading on server-rendered pages
10
- *
11
- * @param url - The smart card URL
12
- * @param cardStatus - The current card resolution status ('pending', 'resolved', etc)
13
- * @param isPageSSRed - Whether the page was server-side rendered
14
- */
15
- declare const useSmartCardReloadAfterCache: (url: string | undefined, cardStatus: string | undefined, isPageSSRed: boolean) => void;
16
- export default useSmartCardReloadAfterCache;
@@ -1,16 +0,0 @@
1
- /**
2
- * Hook to manage smart card reload behavior when content is loaded from local cache.
3
- *
4
- * Handles:
5
- * - Capturing initial card status on mount (synchronously to avoid race conditions)
6
- * - Tracking URL changes and resetting state
7
- * - Only reloading data that was initially loaded from cache
8
- * - Ensuring reload is called at most once per URL
9
- * - Respecting page SSR state to avoid reloading on server-rendered pages
10
- *
11
- * @param url - The smart card URL
12
- * @param cardStatus - The current card resolution status ('pending', 'resolved', etc)
13
- * @param isPageSSRed - Whether the page was server-side rendered
14
- */
15
- declare const useSmartCardReloadAfterCache: (url: string | undefined, cardStatus: string | undefined, isPageSSRed: boolean) => void;
16
- export default useSmartCardReloadAfterCache;