@atlaskit/code 14.6.1 → 14.6.2

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 (41) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/version.json +1 -1
  3. package/dist/es2019/version.json +1 -1
  4. package/dist/esm/version.json +1 -1
  5. package/dist/types-ts4.5/bidi-warning/bidi-warning-decorator.d.ts +12 -0
  6. package/dist/types-ts4.5/bidi-warning/index.d.ts +1 -0
  7. package/dist/types-ts4.5/bidi-warning/ui/index.d.ts +11 -0
  8. package/dist/types-ts4.5/bidi-warning/ui/styled.d.ts +8 -0
  9. package/dist/types-ts4.5/bidi-warning/ui/types.d.ts +29 -0
  10. package/dist/types-ts4.5/code-block.d.ts +13 -0
  11. package/dist/types-ts4.5/code.d.ts +16 -0
  12. package/dist/types-ts4.5/constants.d.ts +625 -0
  13. package/dist/types-ts4.5/entry-points/block.d.ts +2 -0
  14. package/dist/types-ts4.5/entry-points/constants.d.ts +1 -0
  15. package/dist/types-ts4.5/entry-points/inline.d.ts +2 -0
  16. package/dist/types-ts4.5/entry-points/types.d.ts +1 -0
  17. package/dist/types-ts4.5/extract-react-types/code-block.d.ts +47 -0
  18. package/dist/types-ts4.5/extract-react-types/code.d.ts +2 -0
  19. package/dist/types-ts4.5/index.d.ts +4 -0
  20. package/dist/types-ts4.5/internal/hooks/use-highlight.d.ts +6 -0
  21. package/dist/types-ts4.5/internal/theme/constants.d.ts +8 -0
  22. package/dist/types-ts4.5/internal/theme/get-theme.d.ts +7 -0
  23. package/dist/types-ts4.5/internal/theme/styles.d.ts +27 -0
  24. package/dist/types-ts4.5/internal/theme/types.d.ts +57 -0
  25. package/dist/types-ts4.5/internal/types.d.ts +70 -0
  26. package/dist/types-ts4.5/internal/utils/get-normalized-language.d.ts +2 -0
  27. package/dist/types-ts4.5/syntax-highlighter/async.d.ts +3 -0
  28. package/dist/types-ts4.5/syntax-highlighter/index.d.ts +36 -0
  29. package/dist/types-ts4.5/syntax-highlighter/lib/highlight.d.ts +12 -0
  30. package/dist/types-ts4.5/syntax-highlighter/lib/process/create-line-element.d.ts +9 -0
  31. package/dist/types-ts4.5/syntax-highlighter/lib/process/create-line.d.ts +3 -0
  32. package/dist/types-ts4.5/syntax-highlighter/lib/process/flatten-code-tree.d.ts +2 -0
  33. package/dist/types-ts4.5/syntax-highlighter/lib/process/get-code-tree.d.ts +2 -0
  34. package/dist/types-ts4.5/syntax-highlighter/lib/process/get-inline-line-number.d.ts +2 -0
  35. package/dist/types-ts4.5/syntax-highlighter/lib/process/index.d.ts +17 -0
  36. package/dist/types-ts4.5/syntax-highlighter/lib/react-renderer/create-children.d.ts +3 -0
  37. package/dist/types-ts4.5/syntax-highlighter/lib/react-renderer/create-element.d.ts +7 -0
  38. package/dist/types-ts4.5/syntax-highlighter/lib/react-renderer/index.d.ts +15 -0
  39. package/dist/types-ts4.5/syntax-highlighter/types.d.ts +129 -0
  40. package/dist/types-ts4.5/types.d.ts +31 -0
  41. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/code
2
2
 
3
+ ## 14.6.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
8
+
3
9
  ## 14.6.1
4
10
 
5
11
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/code",
3
- "version": "14.6.1",
3
+ "version": "14.6.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/code",
3
- "version": "14.6.1",
3
+ "version": "14.6.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/code",
3
- "version": "14.6.1",
3
+ "version": "14.6.2",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,12 @@
1
+ export declare const bidiCharacterRegex: RegExp;
2
+ /**
3
+ * __Code Bidi Warning Decorator__
4
+ *
5
+ * Checks the code to see if it contains any bidi characters.
6
+ * In case if bidi characters found - returns children with decorated
7
+ * bidi characters. If no bidi characters found - original text returned.
8
+ */
9
+ export default function codeBidiWarningDecorator<DecoratorOutput>(originalText: string, decorate: (options: {
10
+ bidiCharacter: string;
11
+ index?: number;
12
+ }) => DecoratorOutput): string | (string | DecoratorOutput)[];
@@ -0,0 +1 @@
1
+ export { default } from './ui';
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { CodeBidiWarningProps } from './types';
3
+ /**
4
+ * __Bidi Warning__
5
+ *
6
+ * A component used to render a bidi character warning.
7
+ * A bidi character can be used to perform a "bidi override attack".
8
+ *
9
+ * See https://hello.atlassian.net/wiki/spaces/PRODSEC/pages/1347434677/PSHELP-2943+Investigate+Trojan+Source+Attack+Vulnerability#1)-Providing-visual-cues-for-our-Customers-in-our-affected-products
10
+ */
11
+ export default function BidiWarning({ testId, bidiCharacter, skipChildren, tooltipEnabled, label, }: CodeBidiWarningProps): JSX.Element;
@@ -0,0 +1,8 @@
1
+ /** @jsx jsx */
2
+ import { ReactNode } from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ export declare function Decorator({ bidiCharacter, children, testId, }: {
5
+ bidiCharacter: string;
6
+ children: ReactNode;
7
+ testId?: string;
8
+ }): jsx.JSX.Element;
@@ -0,0 +1,29 @@
1
+ export type CodeBidiWarningProps = {
2
+ /**
3
+ * A unique string that appears as a data attribute `data-testid`
4
+ * in the rendered code. Serves as a hook for automated tests.
5
+ */
6
+ testId?: string;
7
+ /**
8
+ * A bidi character which can be used to perform a "bidi override attack". See https://hello.atlassian.net/wiki/spaces/PRODSEC/pages/1347434677/PSHELP-2943+Investigate+Trojan+Source+Attack+Vulnerability#1
9
+ */
10
+ bidiCharacter: string;
11
+ /**
12
+ * Sets whether to render tooltip with the warning or not.
13
+ * Intended to be disabled when used in a mobile view, such as in the editor via mobile bridge,
14
+ * where the tooltip could end up being cut off or otherwise not work as expected.
15
+ * @default true
16
+ */
17
+ tooltipEnabled?: boolean;
18
+ /**
19
+ * Sets whether bidi character should be wrapped in decorator.
20
+ * Useful when wrapping the bidi character with the decoration is not achievable.
21
+ * @default false
22
+ */
23
+ skipChildren?: boolean;
24
+ /**
25
+ * Label for the bidi warning tooltip.
26
+ * @default "Bidirectional characters change the order that text is rendered. This could be used to obscure malicious code."
27
+ */
28
+ label?: string;
29
+ };
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import type { CodeBlockProps } from './internal/types';
3
+ /**
4
+ * __Code block__
5
+ *
6
+ * A code block highlights an entire block of code and keeps the formatting.
7
+ *
8
+ * - [Examples](https://atlassian.design/components/code/code-block/examples)
9
+ * - [Code](https://atlassian.design/components/code/code-block/code)
10
+ * - [Usage](https://atlassian.design/components/code/code-block/usage)
11
+ */
12
+ declare const CodeBlock: import("react").NamedExoticComponent<CodeBlockProps>;
13
+ export default CodeBlock;
@@ -0,0 +1,16 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { getCodeStyles } from './internal/theme/styles';
4
+ import type { CodeProps } from './types';
5
+ /**
6
+ * __Code__
7
+ *
8
+ * Code highlights short strings of code snippets inline with body text.
9
+ *
10
+ * - [Examples](https://atlassian.design/components/code/examples)
11
+ * - [Code](https://atlassian.design/components/code/code)
12
+ * - [Usage](https://atlassian.design/components/code/usage)
13
+ */
14
+ declare const Code: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<CodeProps, "headers" | "method" | "as" | "name" | "testId" | "codeBidiWarnings" | "codeBidiWarningLabel" | "codeBidiWarningTooltipEnabled" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "cite" | "classID" | "cols" | "colSpan" | "content" | "controls" | "coords" | "crossOrigin" | "data" | "dateTime" | "default" | "defer" | "disabled" | "download" | "encType" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "min" | "minLength" | "multiple" | "muted" | "nonce" | "noValidate" | "open" | "optimum" | "pattern" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "size" | "sizes" | "span" | "src" | "srcDoc" | "srcLang" | "srcSet" | "start" | "step" | "summary" | "target" | "type" | "useMap" | "value" | "width" | "wmode" | "wrap" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLElement>>>;
15
+ export { getCodeStyles };
16
+ export default Code;