From e12af985791c23fee58ec23c7878c739f16b9e5b Mon Sep 17 00:00:00 2001 From: Samuel Alev Date: Fri, 10 Jan 2025 14:32:05 +0100 Subject: [PATCH 1/4] fix: prevent loading barrel export of icons --- .../EmojiPicker/EmojiPickerSearchAndClear.tsx | 3 +- .../MarkPlugin/CodePlugin/CodeButton.tsx | 2 +- .../StrikethroughButton.tsx | 2 +- .../components/Toolbar/ToolbarButton.tsx | 2 +- .../src/components/Tree/Tree.stories.tsx | 2 +- .../components/Tree/TreeItem/DragHandle.tsx | 4 +- .../Tree/TreeItem/TreeItemOverlay.tsx | 4 +- .../Tree/TreeWithMultiselect.stories.tsx | 2 +- .../src/foundation/Icon/Icon.stories.tsx | 52 ----------------- packages/fondue/vite.config.ts | 58 +------------------ 10 files changed, 12 insertions(+), 119 deletions(-) delete mode 100644 packages/fondue/src/foundation/Icon/Icon.stories.tsx diff --git a/packages/fondue/src/components/RichTextEditor/Plugins/EmojiPlugin/EmojiPicker/EmojiPickerSearchAndClear.tsx b/packages/fondue/src/components/RichTextEditor/Plugins/EmojiPlugin/EmojiPicker/EmojiPickerSearchAndClear.tsx index 6c31be8eb2..36729cd9e8 100644 --- a/packages/fondue/src/components/RichTextEditor/Plugins/EmojiPlugin/EmojiPicker/EmojiPickerSearchAndClear.tsx +++ b/packages/fondue/src/components/RichTextEditor/Plugins/EmojiPlugin/EmojiPicker/EmojiPickerSearchAndClear.tsx @@ -2,7 +2,8 @@ import { type UseEmojiPickerType } from '@udecode/plate-emoji'; -import { IconCross20, IconMagnifier16 } from '@foundation/Icon'; +import IconCross20 from '@foundation/Icon/Generated/IconCross20'; +import IconMagnifier16 from '@foundation/Icon/Generated/IconMagnifier16'; export type EmojiPickerSearchAndClearProps = Pick; diff --git a/packages/fondue/src/components/RichTextEditor/Plugins/MarkPlugin/CodePlugin/CodeButton.tsx b/packages/fondue/src/components/RichTextEditor/Plugins/MarkPlugin/CodePlugin/CodeButton.tsx index 33e970ac08..ec9a734584 100644 --- a/packages/fondue/src/components/RichTextEditor/Plugins/MarkPlugin/CodePlugin/CodeButton.tsx +++ b/packages/fondue/src/components/RichTextEditor/Plugins/MarkPlugin/CodePlugin/CodeButton.tsx @@ -4,7 +4,7 @@ import { getPluginType } from '@udecode/plate-core'; import { MarkToolbarButton } from '@components/RichTextEditor/Plugins/MarkPlugin/MarkToolbarButton'; import { getTooltip } from '@components/RichTextEditor/helpers/getTooltip'; -import { IconTextBrackets16 } from '@foundation/Icon/Generated'; +import IconTextBrackets16 from '@foundation/Icon/Generated/IconTextBrackets16'; import { ButtonWrapper, IconStylingWrapper } from '../../helper'; import { type PluginButtonProps } from '../../types'; diff --git a/packages/fondue/src/components/RichTextEditor/Plugins/MarkPlugin/StrikethroughPlugin/StrikethroughButton.tsx b/packages/fondue/src/components/RichTextEditor/Plugins/MarkPlugin/StrikethroughPlugin/StrikethroughButton.tsx index 73439f561c..b6f5b07c6e 100644 --- a/packages/fondue/src/components/RichTextEditor/Plugins/MarkPlugin/StrikethroughPlugin/StrikethroughButton.tsx +++ b/packages/fondue/src/components/RichTextEditor/Plugins/MarkPlugin/StrikethroughPlugin/StrikethroughButton.tsx @@ -4,7 +4,7 @@ import { getPluginType } from '@udecode/plate-core'; import { MarkToolbarButton } from '@components/RichTextEditor/Plugins/MarkPlugin/MarkToolbarButton'; import { getTooltip } from '@components/RichTextEditor/helpers/getTooltip'; -import { IconTextFormatStrikethrough } from '@foundation/Icon/Generated'; +import IconTextFormatStrikethrough from '@foundation/Icon/Generated/IconTextFormatStrikethrough'; import { ButtonWrapper, IconStylingWrapper } from '../../helper'; import { type PluginButtonProps } from '../../types'; diff --git a/packages/fondue/src/components/RichTextEditor/components/Toolbar/ToolbarButton.tsx b/packages/fondue/src/components/RichTextEditor/components/Toolbar/ToolbarButton.tsx index ffd90395cd..b4fa023a9e 100644 --- a/packages/fondue/src/components/RichTextEditor/components/Toolbar/ToolbarButton.tsx +++ b/packages/fondue/src/components/RichTextEditor/components/Toolbar/ToolbarButton.tsx @@ -3,7 +3,7 @@ import * as ToolbarPrimitive from '@radix-ui/react-toolbar'; import { type ElementRef, forwardRef } from 'react'; -import { IconCaretDown16 } from '@foundation/Icon'; +import IconCaretDown16 from '@foundation/Icon/Generated/IconCaretDown16'; import { merge } from '@utilities/merge'; import { withTooltip } from './Tooltip'; diff --git a/packages/fondue/src/components/Tree/Tree.stories.tsx b/packages/fondue/src/components/Tree/Tree.stories.tsx index a57f3427d7..c24b20c808 100644 --- a/packages/fondue/src/components/Tree/Tree.stories.tsx +++ b/packages/fondue/src/components/Tree/Tree.stories.tsx @@ -1,5 +1,6 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ +import { IconDocument } from '@frontify/fondue-icons'; import { action } from '@storybook/addon-actions'; import { type Meta, type StoryFn } from '@storybook/react'; import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; @@ -26,7 +27,6 @@ import { useDynamicNavigationMock, useNavigationWithLazyLoadedItemsMock, } from '@components/Tree/utils'; -import IconDocument from '@foundation/Icon/Generated/IconDocument'; import { Modality } from '../../types'; diff --git a/packages/fondue/src/components/Tree/TreeItem/DragHandle.tsx b/packages/fondue/src/components/Tree/TreeItem/DragHandle.tsx index b4d3834201..17fbf1b7f2 100644 --- a/packages/fondue/src/components/Tree/TreeItem/DragHandle.tsx +++ b/packages/fondue/src/components/Tree/TreeItem/DragHandle.tsx @@ -1,8 +1,8 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ +import { IconGrabHandle } from '@frontify/fondue-icons'; import { type ButtonHTMLAttributes, type DetailedHTMLProps, forwardRef } from 'react'; -import IconGrabHandle12 from '@foundation/Icon/Generated/IconGrabHandle12'; import { FOCUS_VISIBLE_STYLE } from '@utilities/focusStyle'; import { merge } from '@utilities/merge'; @@ -33,7 +33,7 @@ export const DragHandle = forwardRef( ])} data-test-id="fondue-tree-item-drag-handle" > - + ); }, diff --git a/packages/fondue/src/components/Tree/TreeItem/TreeItemOverlay.tsx b/packages/fondue/src/components/Tree/TreeItem/TreeItemOverlay.tsx index 73c88ae5e9..4b7b4cac7e 100644 --- a/packages/fondue/src/components/Tree/TreeItem/TreeItemOverlay.tsx +++ b/packages/fondue/src/components/Tree/TreeItem/TreeItemOverlay.tsx @@ -1,8 +1,8 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ +import { IconGrabHandle } from '@frontify/fondue-icons'; import { Children, type ReactNode } from 'react'; -import IconGrabHandle12 from '@foundation/Icon/Generated/IconGrabHandle12'; import { merge } from '@utilities/merge'; import { INDENTATION_WIDTH } from '../helpers'; @@ -37,7 +37,7 @@ export const TreeItemOverlay = ({ const dragHandler = ( ); diff --git a/packages/fondue/src/components/Tree/TreeWithMultiselect.stories.tsx b/packages/fondue/src/components/Tree/TreeWithMultiselect.stories.tsx index b761abb4bd..647fefa9fa 100644 --- a/packages/fondue/src/components/Tree/TreeWithMultiselect.stories.tsx +++ b/packages/fondue/src/components/Tree/TreeWithMultiselect.stories.tsx @@ -1,5 +1,6 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ +import { IconDocument } from '@frontify/fondue-icons'; import { type Meta } from '@storybook/react'; import { useEffect, useState } from 'react'; @@ -15,7 +16,6 @@ import { } from '@components/Tree'; import { type TreeItemStyling, type TreeNodeWithoutElements, type TreeProps } from '@components/Tree/types'; import { type TreeItemMockMultiselect, treeItemsMockMultiseclect } from '@components/Tree/utils'; -import IconDocument from '@foundation/Icon/Generated/IconDocument'; import { TreeItemMultiselect } from './TreeItem/TreeItemMultiselect'; import { getNewSelectedItems } from './helpers'; diff --git a/packages/fondue/src/foundation/Icon/Icon.stories.tsx b/packages/fondue/src/foundation/Icon/Icon.stories.tsx deleted file mode 100644 index 8c23b0bb98..0000000000 --- a/packages/fondue/src/foundation/Icon/Icon.stories.tsx +++ /dev/null @@ -1,52 +0,0 @@ -/* (c) Copyright Frontify Ltd., all rights reserved. */ - -import { type Meta, type StoryFn } from '@storybook/react'; - -import * as AllIcons from './Generated'; -import { IconEnum } from './IconEnum'; -import { type IconProps } from './IconProps'; -import { IconSize } from './IconSize'; - -/** - ### This component is deprecated, please import Icons from the icons package [new Text Input component](/story/icons_icons--default) instead. - */ -export default { - title: 'Foundation/Icon', - args: { - size: IconSize.Size16, - }, - argTypes: { - size: { - options: Object.keys(IconSize), - control: { type: 'select' }, - }, - }, - parameters: { - status: { - type: 'deprecated', - }, - }, -} as Meta; - -export const Icon: StoryFn = (args: IconProps) => ( -
    - {Object.values(IconEnum) - .filter( - (iconName) => - iconName.includes((args?.size || '16').replace('Size', '')) || - !['12', '16', '20', '24', '32'].some((item) => iconName.includes(item)), - ) - .map((iconName) => { - const Icon = AllIcons[`Icon${iconName}`]; - return ( -
  • - - {iconName} -
  • - ); - })} -
-); diff --git a/packages/fondue/vite.config.ts b/packages/fondue/vite.config.ts index fa59d48e90..e1bb83c1a2 100644 --- a/packages/fondue/vite.config.ts +++ b/packages/fondue/vite.config.ts @@ -1,8 +1,7 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ import react from '@vitejs/plugin-react'; -import { build } from 'esbuild'; -import { type Plugin, defineConfig } from 'vite'; +import { defineConfig } from 'vite'; import dts from 'vite-plugin-dts'; import tsConfigPaths from 'vite-tsconfig-paths'; @@ -18,60 +17,6 @@ export const globals = { 'react/jsx-runtime': 'react/jsx-runtime', }; -export const bundleIconsInDevPlugin = (): Plugin => { - let command: string; - return { - name: 'bundle-icons', - config(_config, { command: _command }) { - command = _command; - }, - async load(id: string) { - // Only bundle icons when running the dev server. - if (command === 'serve' && id.endsWith('/Icon/Generated/index.ts')) { - const { outputFiles } = await build({ - absWorkingDir: process.cwd(), - entryPoints: [id], - bundle: true, - write: false, - platform: 'browser', - jsx: 'automatic', - format: 'esm', - plugins: [ - { - name: 'externals', - setup(build) { - build.onResolve({ namespace: 'file', filter: /.*/ }, (args) => { - if (args.kind === 'entry-point') { - return null; - } - - // If the file is in our icons, use standard resolution. - if (args.path.startsWith('./Icon')) { - return null; - } - - // If vendors, mark as external - return { - path: args.path, - external: true, - }; - }); - }, - }, - ], - }); - - if (!outputFiles || outputFiles.length !== 1) { - return null; - } - - return outputFiles[0].text; - } - return null; - }, - }; -}; - export default defineConfig({ // needs to be defined here, such that it is not undefined in the tests. define: { @@ -82,7 +27,6 @@ export default defineConfig({ react(), tsConfigPaths(), dts({ insertTypesEntry: true, rollupTypes: true, exclude: ['**/*.stories.tsx'] }), - bundleIconsInDevPlugin(), ], build: { lib: { From 3d9531b24c8a8bc73c12eb73042e593a0949de30 Mon Sep 17 00:00:00 2001 From: Samuel Alev Date: Fri, 10 Jan 2025 14:51:31 +0100 Subject: [PATCH 2/4] upd --- .../Plugins/TextStylePlugin/TextStyles/custom1Plugin.tsx | 5 ++++- .../Plugins/TextStylePlugin/TextStyles/custom2Plugin.tsx | 5 ++++- .../Plugins/TextStylePlugin/TextStyles/custom3Plugin.tsx | 5 ++++- .../Plugins/TextStylePlugin/TextStyles/heading1Plugin.tsx | 5 ++++- .../Plugins/TextStylePlugin/TextStyles/heading2Plugin.tsx | 5 ++++- .../Plugins/TextStylePlugin/TextStyles/heading3Plugin.tsx | 5 ++++- .../Plugins/TextStylePlugin/TextStyles/heading4Plugin.tsx | 5 ++++- .../TextStylePlugin/TextStyles/imageCaptionPlugin.tsx | 5 ++++- .../Plugins/TextStylePlugin/TextStyles/imageTitlePlugin.tsx | 5 ++++- .../Plugins/TextStylePlugin/TextStyles/paragraphPlugin.tsx | 5 ++++- .../Plugins/TextStylePlugin/TextStyles/quotePlugin.tsx | 5 ++++- .../fondue/src/components/ScrollWrapper/ScrollWrapper.tsx | 3 ++- 12 files changed, 46 insertions(+), 12 deletions(-) diff --git a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/custom1Plugin.tsx b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/custom1Plugin.tsx index 6d0c499c04..ec33264e34 100644 --- a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/custom1Plugin.tsx +++ b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/custom1Plugin.tsx @@ -3,9 +3,12 @@ import { type PlatePlugin, createPluginFactory } from '@udecode/plate-core'; import { type CSSProperties } from 'react'; +import { defaultStyles } from '@components/RichTextEditor/utils/defaultStyles'; import { merge } from '@utilities/merge'; -import { MarkupElement, Plugin, type PluginProps, defaultStyles, getColumnBreakClasses } from '../../..'; +import { getColumnBreakClasses } from '../../ColumnBreakPlugin'; +import { MarkupElement } from '../../MarkupElement'; +import { Plugin, type PluginProps } from '../../Plugin'; import { alignmentClassnames } from '../../helper'; import { type TextStyleRenderElementProps, TextStyles } from '../types'; diff --git a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/custom2Plugin.tsx b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/custom2Plugin.tsx index 9151ccf2ce..4427e7daea 100644 --- a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/custom2Plugin.tsx +++ b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/custom2Plugin.tsx @@ -3,9 +3,12 @@ import { type PlatePlugin, createPluginFactory } from '@udecode/plate-core'; import { type CSSProperties } from 'react'; +import { defaultStyles } from '@components/RichTextEditor/utils/defaultStyles'; import { merge } from '@utilities/merge'; -import { MarkupElement, Plugin, type PluginProps, defaultStyles, getColumnBreakClasses } from '../../..'; +import { getColumnBreakClasses } from '../../ColumnBreakPlugin'; +import { MarkupElement } from '../../MarkupElement'; +import { Plugin, type PluginProps } from '../../Plugin'; import { alignmentClassnames } from '../../helper'; import { type TextStyleRenderElementProps, TextStyles } from '../types'; diff --git a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/custom3Plugin.tsx b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/custom3Plugin.tsx index 440e50c8f0..ac1b0f2a9f 100644 --- a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/custom3Plugin.tsx +++ b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/custom3Plugin.tsx @@ -3,9 +3,12 @@ import { type PlatePlugin, type PlateRenderElementProps, createPluginFactory } from '@udecode/plate-core'; import { type CSSProperties } from 'react'; +import { defaultStyles } from '@components/RichTextEditor/utils/defaultStyles'; import { merge } from '@utilities/merge'; -import { MarkupElement, Plugin, type PluginProps, defaultStyles, getColumnBreakClasses } from '../../..'; +import { getColumnBreakClasses } from '../../ColumnBreakPlugin'; +import { MarkupElement } from '../../MarkupElement'; +import { Plugin, type PluginProps } from '../../Plugin'; import { alignmentClassnames } from '../../helper'; import { type TextStyleRenderElementProps, TextStyles } from '../types'; diff --git a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading1Plugin.tsx b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading1Plugin.tsx index ad68d2f583..a8a574ad3b 100644 --- a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading1Plugin.tsx +++ b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading1Plugin.tsx @@ -3,9 +3,12 @@ import { type PlatePlugin, type PlateRenderElementProps, createPluginFactory } from '@udecode/plate-core'; import { type CSSProperties } from 'react'; +import { defaultStyles } from '@components/RichTextEditor/utils/defaultStyles'; import { merge } from '@utilities/merge'; -import { MarkupElement, Plugin, type PluginProps, defaultStyles, getColumnBreakClasses } from '../../..'; +import { getColumnBreakClasses } from '../../ColumnBreakPlugin'; +import { MarkupElement } from '../../MarkupElement'; +import { Plugin, type PluginProps } from '../../Plugin'; import { alignmentClassnames } from '../../helper'; import { type TextStyleRenderElementProps, TextStyles } from '../types'; diff --git a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading2Plugin.tsx b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading2Plugin.tsx index 50339a74a1..af3e38ea56 100644 --- a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading2Plugin.tsx +++ b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading2Plugin.tsx @@ -3,9 +3,12 @@ import { type PlatePlugin, createPluginFactory } from '@udecode/plate-core'; import { type CSSProperties } from 'react'; +import { defaultStyles } from '@components/RichTextEditor/utils/defaultStyles'; import { merge } from '@utilities/merge'; -import { MarkupElement, Plugin, type PluginProps, defaultStyles, getColumnBreakClasses } from '../../..'; +import { getColumnBreakClasses } from '../../ColumnBreakPlugin'; +import { MarkupElement } from '../../MarkupElement'; +import { Plugin, type PluginProps } from '../../Plugin'; import { alignmentClassnames } from '../../helper'; import { type TextStyleRenderElementProps, TextStyles } from '../types'; diff --git a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading3Plugin.tsx b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading3Plugin.tsx index c28d2899b8..4276c9e0a3 100644 --- a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading3Plugin.tsx +++ b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading3Plugin.tsx @@ -3,9 +3,12 @@ import { type PlatePlugin, createPluginFactory } from '@udecode/plate-core'; import { type CSSProperties } from 'react'; +import { defaultStyles } from '@components/RichTextEditor/utils/defaultStyles'; import { merge } from '@utilities/merge'; -import { MarkupElement, Plugin, type PluginProps, defaultStyles, getColumnBreakClasses } from '../../..'; +import { getColumnBreakClasses } from '../../ColumnBreakPlugin'; +import { MarkupElement } from '../../MarkupElement'; +import { Plugin, type PluginProps } from '../../Plugin'; import { alignmentClassnames } from '../../helper'; import { type TextStyleRenderElementProps, TextStyles } from '../types'; diff --git a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading4Plugin.tsx b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading4Plugin.tsx index e78977c71c..0fc9c3cc28 100644 --- a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading4Plugin.tsx +++ b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/heading4Plugin.tsx @@ -3,9 +3,12 @@ import { type PlatePlugin, createPluginFactory } from '@udecode/plate-core'; import { type CSSProperties } from 'react'; +import { defaultStyles } from '@components/RichTextEditor/utils/defaultStyles'; import { merge } from '@utilities/merge'; -import { MarkupElement, Plugin, type PluginProps, defaultStyles, getColumnBreakClasses } from '../../..'; +import { getColumnBreakClasses } from '../../ColumnBreakPlugin'; +import { MarkupElement } from '../../MarkupElement'; +import { Plugin, type PluginProps } from '../../Plugin'; import { alignmentClassnames } from '../../helper'; import { type TextStyleRenderElementProps, TextStyles } from '../types'; diff --git a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/imageCaptionPlugin.tsx b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/imageCaptionPlugin.tsx index bd7d84cd72..2182b544c3 100644 --- a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/imageCaptionPlugin.tsx +++ b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/imageCaptionPlugin.tsx @@ -3,9 +3,12 @@ import { type PlatePlugin, createPluginFactory } from '@udecode/plate-core'; import { type CSSProperties } from 'react'; +import { defaultStyles } from '@components/RichTextEditor/utils/defaultStyles'; import { merge } from '@utilities/merge'; -import { MarkupElement, Plugin, type PluginProps, defaultStyles, getColumnBreakClasses } from '../../..'; +import { getColumnBreakClasses } from '../../ColumnBreakPlugin/utils/getColumnBreakClasses'; +import { MarkupElement } from '../../MarkupElement'; +import { Plugin, type PluginProps } from '../../Plugin'; import { alignmentClassnames } from '../../helper'; import { type TextStyleRenderElementProps, TextStyles } from '../types'; diff --git a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/imageTitlePlugin.tsx b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/imageTitlePlugin.tsx index 391547ad91..fd385d1040 100644 --- a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/imageTitlePlugin.tsx +++ b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/imageTitlePlugin.tsx @@ -3,9 +3,12 @@ import { type PlatePlugin, createPluginFactory } from '@udecode/plate-core'; import { type CSSProperties } from 'react'; +import { defaultStyles } from '@components/RichTextEditor/utils/defaultStyles'; import { merge } from '@utilities/merge'; -import { MarkupElement, Plugin, type PluginProps, defaultStyles, getColumnBreakClasses } from '../../..'; +import { getColumnBreakClasses } from '../../ColumnBreakPlugin'; +import { MarkupElement } from '../../MarkupElement'; +import { Plugin, type PluginProps } from '../../Plugin'; import { alignmentClassnames } from '../../helper'; import { type TextStyleRenderElementProps, TextStyles } from '../types'; diff --git a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/paragraphPlugin.tsx b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/paragraphPlugin.tsx index 59ef8d2103..0dd907fba2 100644 --- a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/paragraphPlugin.tsx +++ b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/paragraphPlugin.tsx @@ -4,9 +4,12 @@ import { type PlatePlugin, createPluginFactory } from '@udecode/plate-core'; import { createParagraphPlugin as createPlateParagraphPlugin } from '@udecode/plate-paragraph'; import { type CSSProperties } from 'react'; +import { defaultStyles } from '@components/RichTextEditor/utils/defaultStyles'; import { merge } from '@utilities/merge'; -import { MarkupElement, Plugin, type PluginProps, defaultStyles, getColumnBreakClasses } from '../../..'; +import { getColumnBreakClasses } from '../../ColumnBreakPlugin'; +import { MarkupElement } from '../../MarkupElement'; +import { Plugin, type PluginProps } from '../../Plugin'; import { alignmentClassnames } from '../../helper'; import { type TextStyleRenderElementProps, TextStyles } from '../types'; diff --git a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/quotePlugin.tsx b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/quotePlugin.tsx index 9cdc04cf07..97470b9719 100644 --- a/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/quotePlugin.tsx +++ b/packages/fondue/src/components/RichTextEditor/Plugins/TextStylePlugin/TextStyles/quotePlugin.tsx @@ -3,9 +3,12 @@ import { type PlatePlugin, createPluginFactory } from '@udecode/plate-core'; import { type CSSProperties } from 'react'; +import { defaultStyles } from '@components/RichTextEditor/utils/defaultStyles'; import { merge } from '@utilities/merge'; -import { MarkupElement, Plugin, type PluginProps, defaultStyles, getColumnBreakClasses } from '../../..'; +import { getColumnBreakClasses } from '../../ColumnBreakPlugin'; +import { MarkupElement } from '../../MarkupElement'; +import { Plugin, type PluginProps } from '../../Plugin'; import { alignmentClassnames } from '../../helper'; import { type TextStyleRenderElementProps, TextStyles } from '../types'; diff --git a/packages/fondue/src/components/ScrollWrapper/ScrollWrapper.tsx b/packages/fondue/src/components/ScrollWrapper/ScrollWrapper.tsx index 6e114ad0c6..a53658da41 100644 --- a/packages/fondue/src/components/ScrollWrapper/ScrollWrapper.tsx +++ b/packages/fondue/src/components/ScrollWrapper/ScrollWrapper.tsx @@ -3,7 +3,8 @@ import { useFocusRing } from '@react-aria/focus'; import { type ReactElement, useRef } from 'react'; -import { FOCUS_STYLE, merge } from '../..'; +import { FOCUS_STYLE } from '@utilities/focusStyle'; +import { merge } from '@utilities/merge'; import { useScrollWrapper } from './hooks/useScrollWrapper'; import { ScrollWrapperDirection, type ScrollWrapperProps, scrollWrapperDirections } from './types'; From 01a53de64e5e13c7878168d4d36353d50d2c1513 Mon Sep 17 00:00:00 2001 From: Samuel Alev Date: Fri, 10 Jan 2025 14:57:38 +0100 Subject: [PATCH 3/4] revert unneeded changes --- packages/fondue/src/components/Tree/Tree.stories.tsx | 2 +- packages/fondue/src/components/Tree/TreeItem/DragHandle.tsx | 4 ++-- .../fondue/src/components/Tree/TreeItem/TreeItemOverlay.tsx | 4 ++-- .../src/components/Tree/TreeWithMultiselect.stories.tsx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/fondue/src/components/Tree/Tree.stories.tsx b/packages/fondue/src/components/Tree/Tree.stories.tsx index c24b20c808..a57f3427d7 100644 --- a/packages/fondue/src/components/Tree/Tree.stories.tsx +++ b/packages/fondue/src/components/Tree/Tree.stories.tsx @@ -1,6 +1,5 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ -import { IconDocument } from '@frontify/fondue-icons'; import { action } from '@storybook/addon-actions'; import { type Meta, type StoryFn } from '@storybook/react'; import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; @@ -27,6 +26,7 @@ import { useDynamicNavigationMock, useNavigationWithLazyLoadedItemsMock, } from '@components/Tree/utils'; +import IconDocument from '@foundation/Icon/Generated/IconDocument'; import { Modality } from '../../types'; diff --git a/packages/fondue/src/components/Tree/TreeItem/DragHandle.tsx b/packages/fondue/src/components/Tree/TreeItem/DragHandle.tsx index 17fbf1b7f2..b4d3834201 100644 --- a/packages/fondue/src/components/Tree/TreeItem/DragHandle.tsx +++ b/packages/fondue/src/components/Tree/TreeItem/DragHandle.tsx @@ -1,8 +1,8 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ -import { IconGrabHandle } from '@frontify/fondue-icons'; import { type ButtonHTMLAttributes, type DetailedHTMLProps, forwardRef } from 'react'; +import IconGrabHandle12 from '@foundation/Icon/Generated/IconGrabHandle12'; import { FOCUS_VISIBLE_STYLE } from '@utilities/focusStyle'; import { merge } from '@utilities/merge'; @@ -33,7 +33,7 @@ export const DragHandle = forwardRef( ])} data-test-id="fondue-tree-item-drag-handle" > - + ); }, diff --git a/packages/fondue/src/components/Tree/TreeItem/TreeItemOverlay.tsx b/packages/fondue/src/components/Tree/TreeItem/TreeItemOverlay.tsx index 4b7b4cac7e..73c88ae5e9 100644 --- a/packages/fondue/src/components/Tree/TreeItem/TreeItemOverlay.tsx +++ b/packages/fondue/src/components/Tree/TreeItem/TreeItemOverlay.tsx @@ -1,8 +1,8 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ -import { IconGrabHandle } from '@frontify/fondue-icons'; import { Children, type ReactNode } from 'react'; +import IconGrabHandle12 from '@foundation/Icon/Generated/IconGrabHandle12'; import { merge } from '@utilities/merge'; import { INDENTATION_WIDTH } from '../helpers'; @@ -37,7 +37,7 @@ export const TreeItemOverlay = ({ const dragHandler = ( ); diff --git a/packages/fondue/src/components/Tree/TreeWithMultiselect.stories.tsx b/packages/fondue/src/components/Tree/TreeWithMultiselect.stories.tsx index 647fefa9fa..b761abb4bd 100644 --- a/packages/fondue/src/components/Tree/TreeWithMultiselect.stories.tsx +++ b/packages/fondue/src/components/Tree/TreeWithMultiselect.stories.tsx @@ -1,6 +1,5 @@ /* (c) Copyright Frontify Ltd., all rights reserved. */ -import { IconDocument } from '@frontify/fondue-icons'; import { type Meta } from '@storybook/react'; import { useEffect, useState } from 'react'; @@ -16,6 +15,7 @@ import { } from '@components/Tree'; import { type TreeItemStyling, type TreeNodeWithoutElements, type TreeProps } from '@components/Tree/types'; import { type TreeItemMockMultiselect, treeItemsMockMultiseclect } from '@components/Tree/utils'; +import IconDocument from '@foundation/Icon/Generated/IconDocument'; import { TreeItemMultiselect } from './TreeItem/TreeItemMultiselect'; import { getNewSelectedItems } from './helpers'; From 97d51b1fa662e796d0045857dec3ea7a57977b9a Mon Sep 17 00:00:00 2001 From: Samuel Alev Date: Fri, 10 Jan 2025 15:04:09 +0100 Subject: [PATCH 4/4] chore: changeset --- .changeset/odd-needles-swim.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/odd-needles-swim.md diff --git a/.changeset/odd-needles-swim.md b/.changeset/odd-needles-swim.md new file mode 100644 index 0000000000..f01165555e --- /dev/null +++ b/.changeset/odd-needles-swim.md @@ -0,0 +1,5 @@ +--- +"@frontify/fondue": patch +--- + +fix: prevent loading barrel export of icons