Skip to content

Commit

Permalink
move INHERITABLE_PROPERTIES to roosterjs-editor-types
Browse files Browse the repository at this point in the history
  • Loading branch information
miku1958 committed Jun 3, 2024
1 parent 539ffa9 commit 4f489bf
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 37 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { INHERITABLE_PROPERTIES } from 'roosterjs-editor-dom/lib/htmlSanitizer/getInheritableStyles';
import { INHERITABLE_PROPERTIES } from 'roosterjs-editor-types';
import { isNodeOfType } from '../../domUtils/isNodeOfType';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import { INHERITABLE_PROPERTIES } from 'roosterjs-editor-types';
import type { StringMap } from 'roosterjs-editor-types';

// Inheritable CSS properties
// Ref: https://www.w3.org/TR/CSS21/propidx.html
export const INHERITABLE_PROPERTIES = (
'border-spacing,caption-side,color,' +
'cursor,direction,empty-cells,font-family,font-size,font-style,font-variant,font-weight,' +
'font,letter-spacing,line-height,list-style-image,list-style-position,list-style-type,' +
'list-style,orphans,quotes,text-align,text-indent,text-transform,visibility,white-space,' +
'widows,word-spacing'
).split(',');

/**
* Get inheritable CSS style values from the given element
* @param element The element to get style from
Expand Down
9 changes: 9 additions & 0 deletions packages/roosterjs-editor-types/lib/Constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Inheritable CSS properties
// Ref: https://www.w3.org/TR/CSS21/propidx.html
export const INHERITABLE_PROPERTIES = (
'border-spacing,caption-side,color,' +
'cursor,direction,empty-cells,font-family,font-size,font-style,font-variant,font-weight,' +
'font,letter-spacing,line-height,list-style-image,list-style-position,list-style-type,' +
'list-style,orphans,quotes,text-align,text-indent,text-transform,visibility,white-space,' +
'widows,word-spacing'
).split(',');
53 changes: 27 additions & 26 deletions packages/roosterjs-editor-types/lib/type/index.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
export {
AttributeCallback,
AttributeCallbackMap,
CssStyleCallback,
CssStyleCallbackMap,
ElementCallback,
StringMap,
ElementCallbackMap,
PredefinedCssMap,
} from './htmlSanitizerCallbackTypes';
export { DOMEventHandlerFunction, DOMEventHandlerObject, DOMEventHandler } from './domEventHandler';
export { TrustedHTMLHandler } from './TrustedHTMLHandler';
export { SizeTransformer } from './SizeTransformer';
export {
ArrayItemType,
DefinitionBase,
StringDefinition,
NumberDefinition,
BooleanDefinition,
ArrayDefinition,
ObjectDefinition,
ObjectPropertyDefinition,
CustomizeDefinition,
Definition,
} from './Definition';
export { CoreCreator } from './CoreCreator';
export {
AttributeCallback,
AttributeCallbackMap,
CssStyleCallback,
CssStyleCallbackMap,
ElementCallback,
StringMap,
ElementCallbackMap,
PredefinedCssMap,
} from './htmlSanitizerCallbackTypes';
export { DOMEventHandlerFunction, DOMEventHandlerObject, DOMEventHandler } from './domEventHandler';
export { TrustedHTMLHandler } from './TrustedHTMLHandler';
export { SizeTransformer } from './SizeTransformer';
export {
ArrayItemType,
DefinitionBase,
StringDefinition,
NumberDefinition,
BooleanDefinition,
ArrayDefinition,
ObjectDefinition,
ObjectPropertyDefinition,
CustomizeDefinition,
Definition,
} from './Definition';
export { CoreCreator } from './CoreCreator';
export { INHERITABLE_PROPERTIES } from '../Constants';

0 comments on commit 4f489bf

Please sign in to comment.