@atlaskit/code 14.3.9 → 14.3.10

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 (36) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/bidi-warning/package.json +8 -1
  3. package/bidi-warning-decorator/package.json +8 -1
  4. package/block/package.json +8 -1
  5. package/constants/package.json +8 -1
  6. package/dist/cjs/version.json +1 -1
  7. package/dist/es2019/version.json +1 -1
  8. package/dist/esm/version.json +1 -1
  9. package/dist/types/code.d.ts +1 -1
  10. package/dist/types-ts4.0/bidi-warning/bidi-warning-decorator.d.ts +5 -0
  11. package/dist/types-ts4.0/bidi-warning/index.d.ts +1 -0
  12. package/dist/types-ts4.0/bidi-warning/ui/index.d.ts +3 -0
  13. package/dist/types-ts4.0/bidi-warning/ui/styled.d.ts +7 -0
  14. package/dist/types-ts4.0/bidi-warning/ui/types.d.ts +33 -0
  15. package/dist/types-ts4.0/code-block.d.ts +13 -0
  16. package/dist/types-ts4.0/code.d.ts +16 -0
  17. package/dist/types-ts4.0/constants.d.ts +625 -0
  18. package/dist/types-ts4.0/entry-points/block.d.ts +2 -0
  19. package/dist/types-ts4.0/entry-points/constants.d.ts +1 -0
  20. package/dist/types-ts4.0/entry-points/inline.d.ts +2 -0
  21. package/dist/types-ts4.0/entry-points/types.d.ts +1 -0
  22. package/dist/types-ts4.0/extract-react-types/code-block.d.ts +37 -0
  23. package/dist/types-ts4.0/extract-react-types/code.d.ts +2 -0
  24. package/dist/types-ts4.0/index.d.ts +4 -0
  25. package/dist/types-ts4.0/internal/hooks/use-highlight.d.ts +6 -0
  26. package/dist/types-ts4.0/internal/theme/constants.d.ts +8 -0
  27. package/dist/types-ts4.0/internal/theme/get-theme.d.ts +7 -0
  28. package/dist/types-ts4.0/internal/theme/styles.d.ts +19 -0
  29. package/dist/types-ts4.0/internal/theme/types.d.ts +57 -0
  30. package/dist/types-ts4.0/internal/types.d.ts +57 -0
  31. package/dist/types-ts4.0/internal/utils/get-normalized-language.d.ts +2 -0
  32. package/dist/types-ts4.0/react-syntax-highlighter-bidi-warning-renderer.d.ts +9 -0
  33. package/dist/types-ts4.0/types.d.ts +32 -0
  34. package/inline/package.json +8 -1
  35. package/package.json +13 -5
  36. package/types/package.json +8 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/code
2
2
 
3
+ ## 14.3.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
8
+
3
9
  ## 14.3.9
4
10
 
5
11
  ### Patch Changes
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/bidi-warning/index.js",
5
5
  "module:es2019": "../dist/es2019/bidi-warning/index.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/bidi-warning/index.d.ts"
7
+ "types": "../dist/types/bidi-warning/index.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/bidi-warning/index.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/bidi-warning/bidi-warning-decorator.js",
5
5
  "module:es2019": "../dist/es2019/bidi-warning/bidi-warning-decorator.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/bidi-warning/bidi-warning-decorator.d.ts"
7
+ "types": "../dist/types/bidi-warning/bidi-warning-decorator.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/bidi-warning/bidi-warning-decorator.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/entry-points/block.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/block.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/block.d.ts"
7
+ "types": "../dist/types/entry-points/block.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/entry-points/block.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/entry-points/constants.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/constants.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/constants.d.ts"
7
+ "types": "../dist/types/entry-points/constants.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/entry-points/constants.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/code",
3
- "version": "14.3.9",
3
+ "version": "14.3.10",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/code",
3
- "version": "14.3.9",
3
+ "version": "14.3.10",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/code",
3
- "version": "14.3.9",
3
+ "version": "14.3.10",
4
4
  "sideEffects": false
5
5
  }
@@ -11,6 +11,6 @@ import type { CodeProps } from './types';
11
11
  * - [Code](https://atlassian.design/components/code/code)
12
12
  * - [Usage](https://atlassian.design/components/code/usage)
13
13
  */
14
- declare const Code: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<CodeProps, "as" | "css" | "name" | "testId" | "codeBidiWarnings" | "codeBidiWarningLabel" | "codeBidiWarningTooltipEnabled" | "list" | "step" | "color" | "content" | "height" | "width" | "start" | "hidden" | "size" | "style" | "default" | "wrap" | "open" | "multiple" | "disabled" | "children" | "cite" | "data" | "form" | "label" | "span" | "summary" | "title" | "pattern" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "min" | "minLength" | "muted" | "nonce" | "noValidate" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "required" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "target" | "type" | "useMap" | "value" | "wmode" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "slot" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "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" | "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>>>;
14
+ declare const Code: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<CodeProps, "as" | "css" | "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" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "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
15
  export { getCodeStyles };
16
16
  export default Code;
@@ -0,0 +1,5 @@
1
+ export declare const bidiCharacterRegex: RegExp;
2
+ export default function codeBidiWarningDecorator<DecoratorOutput>(originalText: string, decorate: (options: {
3
+ bidiCharacter: string;
4
+ index?: number;
5
+ }) => DecoratorOutput): string | (string | DecoratorOutput)[];
@@ -0,0 +1 @@
1
+ export { default } from './ui';
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { CodeBidiWarningProps } from './types';
3
+ export default function BidiWarning({ testId, bidiCharacter, skipChildren, tooltipEnabled, label, }: CodeBidiWarningProps): JSX.Element;
@@ -0,0 +1,7 @@
1
+ /** @jsx jsx */
2
+ import { ReactNode } from 'react';
3
+ export declare function Decorator({ bidiCharacter, children, testId, }: {
4
+ bidiCharacter: string;
5
+ children: ReactNode;
6
+ testId?: string;
7
+ }): JSX.Element;
@@ -0,0 +1,33 @@
1
+ export declare type CodeBidiWarningProps = {
2
+ /**
3
+ * A `testId` prop is provided for specified elements, which is a unique
4
+ * string that appears as a data attribute `data-testid` in the rendered code,
5
+ * serving as a hook for automated tests
6
+ */
7
+ testId?: string;
8
+ /**
9
+ * A bidi character which can be used to perform a "bidi override attack".
10
+ *
11
+ * See the following document for details.
12
+ *
13
+ * 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
14
+ */
15
+ bidiCharacter: string;
16
+ /**
17
+ * Defaults to enabled (true)
18
+ *
19
+ * Intended to be disabled when used in a mobile view, such as in the editor
20
+ * via mobile bridge, where the tooltip could end up being cut off of otherwise
21
+ * not work as expected.
22
+ */
23
+ tooltipEnabled?: boolean;
24
+ /**
25
+ * Useful when wrapping the bidi character with the decoration is not achievable.
26
+ */
27
+ skipChildren?: boolean;
28
+ /**
29
+ * Labels for the previous and next buttons used in pagination.
30
+ * Defaults to `Bidirectional characters change the order that text is rendered. This could be used to obscure malicious code.`.
31
+ */
32
+ label?: string;
33
+ };
@@ -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, "as" | "css" | "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" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "label" | "list" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "max" | "maxLength" | "media" | "mediaGroup" | "method" | "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;
@@ -0,0 +1,625 @@
1
+ export declare const SUPPORTED_LANGUAGES: readonly [
2
+ {
3
+ readonly name: "PHP";
4
+ readonly alias: readonly [
5
+ "php",
6
+ "php3",
7
+ "php4",
8
+ "php5"
9
+ ];
10
+ readonly value: "php";
11
+ },
12
+ {
13
+ readonly name: "Java";
14
+ readonly alias: readonly [
15
+ "java"
16
+ ];
17
+ readonly value: "java";
18
+ },
19
+ {
20
+ readonly name: "CSharp";
21
+ readonly alias: readonly [
22
+ "csharp",
23
+ "c#"
24
+ ];
25
+ readonly value: "cs";
26
+ },
27
+ {
28
+ readonly name: "Python";
29
+ readonly alias: readonly [
30
+ "python",
31
+ "py"
32
+ ];
33
+ readonly value: "python";
34
+ },
35
+ {
36
+ readonly name: "JavaScript";
37
+ readonly alias: readonly [
38
+ "javascript",
39
+ "js"
40
+ ];
41
+ readonly value: "javascript";
42
+ },
43
+ {
44
+ readonly name: "Html";
45
+ readonly alias: readonly [
46
+ "html"
47
+ ];
48
+ readonly value: "xml";
49
+ },
50
+ {
51
+ readonly name: "C++";
52
+ readonly alias: readonly [
53
+ "c++",
54
+ "cpp",
55
+ "clike"
56
+ ];
57
+ readonly value: "cpp";
58
+ },
59
+ {
60
+ readonly name: "Ruby";
61
+ readonly alias: readonly [
62
+ "ruby",
63
+ "rb",
64
+ "duby"
65
+ ];
66
+ readonly value: "ruby";
67
+ },
68
+ {
69
+ readonly name: "Objective-C";
70
+ readonly alias: readonly [
71
+ "objective-c",
72
+ "objectivec",
73
+ "obj-c",
74
+ "objc"
75
+ ];
76
+ readonly value: "objectivec";
77
+ },
78
+ {
79
+ readonly name: "C";
80
+ readonly alias: readonly [
81
+ "c"
82
+ ];
83
+ readonly value: "cpp";
84
+ },
85
+ {
86
+ readonly name: "Swift";
87
+ readonly alias: readonly [
88
+ "swift"
89
+ ];
90
+ readonly value: "swift";
91
+ },
92
+ {
93
+ readonly name: "TeX";
94
+ readonly alias: readonly [
95
+ "tex",
96
+ "latex"
97
+ ];
98
+ readonly value: "tex";
99
+ },
100
+ {
101
+ readonly name: "Shell";
102
+ readonly alias: readonly [
103
+ "shell",
104
+ "bash",
105
+ "sh",
106
+ "ksh",
107
+ "zsh"
108
+ ];
109
+ readonly value: "shell";
110
+ },
111
+ {
112
+ readonly name: "Scala";
113
+ readonly alias: readonly [
114
+ "scala"
115
+ ];
116
+ readonly value: "scala";
117
+ },
118
+ {
119
+ readonly name: "Go";
120
+ readonly alias: readonly [
121
+ "go"
122
+ ];
123
+ readonly value: "go";
124
+ },
125
+ {
126
+ readonly name: "ActionScript";
127
+ readonly alias: readonly [
128
+ "actionscript",
129
+ "actionscript3",
130
+ "as"
131
+ ];
132
+ readonly value: "actionscript";
133
+ },
134
+ {
135
+ readonly name: "ColdFusion";
136
+ readonly alias: readonly [
137
+ "coldfusion"
138
+ ];
139
+ readonly value: "xml";
140
+ },
141
+ {
142
+ readonly name: "JavaFX";
143
+ readonly alias: readonly [
144
+ "javafx",
145
+ "jfx"
146
+ ];
147
+ readonly value: "java";
148
+ },
149
+ {
150
+ readonly name: "VbNet";
151
+ readonly alias: readonly [
152
+ "vbnet",
153
+ "vb.net",
154
+ "vfp",
155
+ "clipper",
156
+ "xbase"
157
+ ];
158
+ readonly value: "vbnet";
159
+ },
160
+ {
161
+ readonly name: "JSON";
162
+ readonly alias: readonly [
163
+ "json"
164
+ ];
165
+ readonly value: "json";
166
+ },
167
+ {
168
+ readonly name: "MATLAB";
169
+ readonly alias: readonly [
170
+ "matlab"
171
+ ];
172
+ readonly value: "matlab";
173
+ },
174
+ {
175
+ readonly name: "Groovy";
176
+ readonly alias: readonly [
177
+ "groovy"
178
+ ];
179
+ readonly value: "groovy";
180
+ },
181
+ {
182
+ readonly name: "SQL";
183
+ readonly alias: readonly [
184
+ "sql",
185
+ "postgresql",
186
+ "postgres",
187
+ "plpgsql",
188
+ "psql",
189
+ "postgresql-console",
190
+ "postgres-console",
191
+ "tsql",
192
+ "t-sql",
193
+ "mysql",
194
+ "sqlite"
195
+ ];
196
+ readonly value: "sql";
197
+ },
198
+ {
199
+ readonly name: "R";
200
+ readonly alias: readonly [
201
+ "r"
202
+ ];
203
+ readonly value: "r";
204
+ },
205
+ {
206
+ readonly name: "Perl";
207
+ readonly alias: readonly [
208
+ "perl",
209
+ "pl"
210
+ ];
211
+ readonly value: "perl";
212
+ },
213
+ {
214
+ readonly name: "Lua";
215
+ readonly alias: readonly [
216
+ "lua"
217
+ ];
218
+ readonly value: "lua";
219
+ },
220
+ {
221
+ readonly name: "Pascal";
222
+ readonly alias: readonly [
223
+ "pas",
224
+ "pascal",
225
+ "objectpascal",
226
+ "delphi"
227
+ ];
228
+ readonly value: "pascal";
229
+ },
230
+ {
231
+ readonly name: "XML";
232
+ readonly alias: readonly [
233
+ "xml"
234
+ ];
235
+ readonly value: "xml";
236
+ },
237
+ {
238
+ readonly name: "TypeScript";
239
+ readonly alias: readonly [
240
+ "typescript",
241
+ "ts"
242
+ ];
243
+ readonly value: "typescript";
244
+ },
245
+ {
246
+ readonly name: "CoffeeScript";
247
+ readonly alias: readonly [
248
+ "coffeescript",
249
+ "coffee-script",
250
+ "coffee"
251
+ ];
252
+ readonly value: "coffeescript";
253
+ },
254
+ {
255
+ readonly name: "Haskell";
256
+ readonly alias: readonly [
257
+ "haskell",
258
+ "hs"
259
+ ];
260
+ readonly value: "haskell";
261
+ },
262
+ {
263
+ readonly name: "Puppet";
264
+ readonly alias: readonly [
265
+ "puppet"
266
+ ];
267
+ readonly value: "puppet";
268
+ },
269
+ {
270
+ readonly name: "Arduino";
271
+ readonly alias: readonly [
272
+ "arduino"
273
+ ];
274
+ readonly value: "arduino";
275
+ },
276
+ {
277
+ readonly name: "Fortran";
278
+ readonly alias: readonly [
279
+ "fortran"
280
+ ];
281
+ readonly value: "fortran";
282
+ },
283
+ {
284
+ readonly name: "Erlang";
285
+ readonly alias: readonly [
286
+ "erlang",
287
+ "erl"
288
+ ];
289
+ readonly value: "erlang";
290
+ },
291
+ {
292
+ readonly name: "PowerShell";
293
+ readonly alias: readonly [
294
+ "powershell",
295
+ "posh",
296
+ "ps1",
297
+ "psm1"
298
+ ];
299
+ readonly value: "powershell";
300
+ },
301
+ {
302
+ readonly name: "Haxe";
303
+ readonly alias: readonly [
304
+ "haxe",
305
+ "hx",
306
+ "hxsl"
307
+ ];
308
+ readonly value: "haxe";
309
+ },
310
+ {
311
+ readonly name: "Elixir";
312
+ readonly alias: readonly [
313
+ "elixir",
314
+ "ex",
315
+ "exs"
316
+ ];
317
+ readonly value: "elixir";
318
+ },
319
+ {
320
+ readonly name: "Verilog";
321
+ readonly alias: readonly [
322
+ "verilog",
323
+ "v"
324
+ ];
325
+ readonly value: "verilog";
326
+ },
327
+ {
328
+ readonly name: "Rust";
329
+ readonly alias: readonly [
330
+ "rust"
331
+ ];
332
+ readonly value: "rust";
333
+ },
334
+ {
335
+ readonly name: "VHDL";
336
+ readonly alias: readonly [
337
+ "vhdl"
338
+ ];
339
+ readonly value: "vhdl";
340
+ },
341
+ {
342
+ readonly name: "Sass";
343
+ readonly alias: readonly [
344
+ "sass"
345
+ ];
346
+ readonly value: "less";
347
+ },
348
+ {
349
+ readonly name: "OCaml";
350
+ readonly alias: readonly [
351
+ "ocaml"
352
+ ];
353
+ readonly value: "ocaml";
354
+ },
355
+ {
356
+ readonly name: "Dart";
357
+ readonly alias: readonly [
358
+ "dart"
359
+ ];
360
+ readonly value: "dart";
361
+ },
362
+ {
363
+ readonly name: "CSS";
364
+ readonly alias: readonly [
365
+ "css"
366
+ ];
367
+ readonly value: "css";
368
+ },
369
+ {
370
+ readonly name: "reStructuredText";
371
+ readonly alias: readonly [
372
+ "restructuredtext",
373
+ "rst",
374
+ "rest"
375
+ ];
376
+ readonly value: "rest";
377
+ },
378
+ {
379
+ readonly name: "Kotlin";
380
+ readonly alias: readonly [
381
+ "kotlin"
382
+ ];
383
+ readonly value: "kotlin";
384
+ },
385
+ {
386
+ readonly name: "D";
387
+ readonly alias: readonly [
388
+ "d"
389
+ ];
390
+ readonly value: "d";
391
+ },
392
+ {
393
+ readonly name: "Octave";
394
+ readonly alias: readonly [
395
+ "octave"
396
+ ];
397
+ readonly value: "matlab";
398
+ },
399
+ {
400
+ readonly name: "QML";
401
+ readonly alias: readonly [
402
+ "qbs",
403
+ "qml"
404
+ ];
405
+ readonly value: "qml";
406
+ },
407
+ {
408
+ readonly name: "Prolog";
409
+ readonly alias: readonly [
410
+ "prolog"
411
+ ];
412
+ readonly value: "prolog";
413
+ },
414
+ {
415
+ readonly name: "FoxPro";
416
+ readonly alias: readonly [
417
+ "foxpro",
418
+ "purebasic"
419
+ ];
420
+ readonly value: "purebasic";
421
+ },
422
+ {
423
+ readonly name: "Scheme";
424
+ readonly alias: readonly [
425
+ "scheme",
426
+ "scm"
427
+ ];
428
+ readonly value: "scheme";
429
+ },
430
+ {
431
+ readonly name: "CUDA";
432
+ readonly alias: readonly [
433
+ "cuda",
434
+ "cu"
435
+ ];
436
+ readonly value: "cpp";
437
+ },
438
+ {
439
+ readonly name: "Julia";
440
+ readonly alias: readonly [
441
+ "julia",
442
+ "jl"
443
+ ];
444
+ readonly value: "julia";
445
+ },
446
+ {
447
+ readonly name: "Racket";
448
+ readonly alias: readonly [
449
+ "racket",
450
+ "rkt"
451
+ ];
452
+ readonly value: "lisp";
453
+ },
454
+ {
455
+ readonly name: "Ada";
456
+ readonly alias: readonly [
457
+ "ada",
458
+ "ada95",
459
+ "ada2005"
460
+ ];
461
+ readonly value: "ada";
462
+ },
463
+ {
464
+ readonly name: "Tcl";
465
+ readonly alias: readonly [
466
+ "tcl"
467
+ ];
468
+ readonly value: "tcl";
469
+ },
470
+ {
471
+ readonly name: "Mathematica";
472
+ readonly alias: readonly [
473
+ "mathematica",
474
+ "mma",
475
+ "nb"
476
+ ];
477
+ readonly value: "mathematica";
478
+ },
479
+ {
480
+ readonly name: "Autoit";
481
+ readonly alias: readonly [
482
+ "autoit"
483
+ ];
484
+ readonly value: "autoit";
485
+ },
486
+ {
487
+ readonly name: "StandardML";
488
+ readonly alias: readonly [
489
+ "standardmL",
490
+ "sml",
491
+ "standardml"
492
+ ];
493
+ readonly value: "sml";
494
+ },
495
+ {
496
+ readonly name: "Objective-J";
497
+ readonly alias: readonly [
498
+ "objective-j",
499
+ "objectivej",
500
+ "obj-j",
501
+ "objj"
502
+ ];
503
+ readonly value: "objectivec";
504
+ },
505
+ {
506
+ readonly name: "Smalltalk";
507
+ readonly alias: readonly [
508
+ "smalltalk",
509
+ "squeak",
510
+ "st"
511
+ ];
512
+ readonly value: "smalltalk";
513
+ },
514
+ {
515
+ readonly name: "Vala";
516
+ readonly alias: readonly [
517
+ "vala",
518
+ "vapi"
519
+ ];
520
+ readonly value: "vala";
521
+ },
522
+ {
523
+ readonly name: "ABAP";
524
+ readonly alias: readonly [
525
+ "abap"
526
+ ];
527
+ readonly value: "sql";
528
+ },
529
+ {
530
+ readonly name: "LiveScript";
531
+ readonly alias: readonly [
532
+ "livescript",
533
+ "live-script"
534
+ ];
535
+ readonly value: "livescript";
536
+ },
537
+ {
538
+ readonly name: "XQuery";
539
+ readonly alias: readonly [
540
+ "xquery",
541
+ "xqy",
542
+ "xq",
543
+ "xql",
544
+ "xqm"
545
+ ];
546
+ readonly value: "xquery";
547
+ },
548
+ {
549
+ readonly name: "PlainText";
550
+ readonly alias: readonly [
551
+ "text",
552
+ "plaintext"
553
+ ];
554
+ readonly value: "text";
555
+ },
556
+ {
557
+ readonly name: "Yaml";
558
+ readonly alias: readonly [
559
+ "yaml",
560
+ "yml"
561
+ ];
562
+ readonly value: "yaml";
563
+ },
564
+ {
565
+ readonly name: "GraphQL";
566
+ readonly alias: readonly [
567
+ "graphql"
568
+ ];
569
+ readonly value: "graphql";
570
+ },
571
+ {
572
+ readonly name: "AppleScript";
573
+ readonly alias: readonly [
574
+ "applescript"
575
+ ];
576
+ readonly value: "applescript";
577
+ },
578
+ {
579
+ readonly name: "Clojure";
580
+ readonly alias: readonly [
581
+ "clojure"
582
+ ];
583
+ readonly value: "clojure";
584
+ },
585
+ {
586
+ readonly name: "Diff";
587
+ readonly alias: readonly [
588
+ "diff"
589
+ ];
590
+ readonly value: "diff";
591
+ },
592
+ {
593
+ readonly name: "VisualBasic";
594
+ readonly alias: readonly [
595
+ "visualbasic"
596
+ ];
597
+ readonly value: "visual-basic";
598
+ },
599
+ {
600
+ readonly name: "JSX";
601
+ readonly alias: readonly [
602
+ "jsx"
603
+ ];
604
+ readonly value: "jsx";
605
+ },
606
+ {
607
+ readonly name: "TSX";
608
+ readonly alias: readonly [
609
+ "tsx"
610
+ ];
611
+ readonly value: "tsx";
612
+ },
613
+ {
614
+ readonly name: "SplunkSPL";
615
+ readonly alias: readonly [
616
+ "splunk-spl"
617
+ ];
618
+ readonly value: "splunk-spl";
619
+ }
620
+ ];
621
+ export { CODE_BLOCK_SELECTOR } from './internal/theme/constants';
622
+ export declare type Language = typeof SUPPORTED_LANGUAGES[number];
623
+ export declare type LanguageAlias = typeof SUPPORTED_LANGUAGES[number]['alias'][number];
624
+ export declare type LanguageName = typeof SUPPORTED_LANGUAGES[number]['name'];
625
+ export declare type SupportedLanguages = LanguageName | LanguageAlias;
@@ -0,0 +1,2 @@
1
+ export { default } from '../code-block';
2
+ export type { CodeBlockProps } from '../types';
@@ -0,0 +1 @@
1
+ export { SUPPORTED_LANGUAGES } from '../constants';
@@ -0,0 +1,2 @@
1
+ export { default, getCodeStyles } from '../code';
2
+ export type { CodeBlockProps } from '../types';
@@ -0,0 +1 @@
1
+ export type { CodeBlockProps, CodeProps, SupportedLanguages, LanguageAlias, Language, } from '../types';
@@ -0,0 +1,37 @@
1
+ export default function CodeBlock(__: {
2
+ /**
3
+ * The code to be formatted
4
+ */
5
+ text: string;
6
+ /**
7
+ * A unique string that appears as a data attribute `data-testid`
8
+ * in the rendered code. Serves as a hook for automated tests.
9
+ */
10
+ testId?: string;
11
+ /**
12
+ * Whether to showLineNumbers or not, defaults to true
13
+ */
14
+ showLineNumbers?: boolean;
15
+ /**
16
+ * The language in which the code is written
17
+ * @see `SupportedLanguages` for type information in src
18
+ */
19
+ language?: string;
20
+ /**
21
+ * Lines to highlight comma delimited.
22
+ *
23
+ * Example uses:
24
+ * - To highlight one line `highlight="3"`
25
+ * - To highlight a group of lines `highlight="1-5"`
26
+ * - To highlight multiple groups `highlight="1-5,7,10,15-20"`
27
+ */
28
+ highlight?: string;
29
+ /**
30
+ * Screen reader text for the start of a highlighted line
31
+ */
32
+ highlightedStartText?: string;
33
+ /**
34
+ * Screen reader text for the end of a highlighted line
35
+ */
36
+ highlightedEndText?: string;
37
+ }): null;
@@ -0,0 +1,2 @@
1
+ import type { CodeProps } from '../types';
2
+ export default function _(__: CodeProps): null;
@@ -0,0 +1,4 @@
1
+ export { default as Code, getCodeStyles } from './code';
2
+ export { default as CodeBlock } from './code-block';
3
+ export type { CodeBlockProps, CodeProps, SupportedLanguages, LanguageAlias, Language, } from './types';
4
+ export { SUPPORTED_LANGUAGES } from './constants';
@@ -0,0 +1,6 @@
1
+ import { HTMLProps } from 'react';
2
+ import type { CodeBlockProps } from '../types';
3
+ export declare const useHighlightLines: ({ highlight, testId, }: Pick<CodeBlockProps, 'highlight' | 'testId'>) => {
4
+ getHighlightStyles: (lineNumber: number, highlightedLines: number[]) => HTMLProps<HTMLElement>;
5
+ highlightedLines: number[];
6
+ };
@@ -0,0 +1,8 @@
1
+ export declare const CODE_FONT_SIZE = 12;
2
+ export declare const CODE_LINE_HEIGHT = "20px";
3
+ export declare const HIGHLIGHT_BORDER_WIDTH = "4px";
4
+ export declare const SPACING: number;
5
+ export declare const LINE_NUMBER_GUTTER: number;
6
+ export declare const VAR_CODE_LINE_NUMBER_BG_COLOR = "--ds--code--line-number-bg-color";
7
+ export declare const VAR_CODE_BG_COLOR = "--ds--code--bg-color";
8
+ export declare const CODE_BLOCK_SELECTOR = "data-ds--code--code-block";
@@ -0,0 +1,7 @@
1
+ import type { Theme } from '@atlaskit/theme/types';
2
+ import type { CodeBlockTheme, CodeTheme } from './types';
3
+ export declare const getBaseTheme: (theme: Theme) => CodeTheme;
4
+ export declare const defaultBaseTheme: CodeTheme;
5
+ export declare const getColorPalette: import("memoize-one").MemoizedFn<(theme: Theme) => CodeBlockTheme>;
6
+ declare const getTheme: (theme: Theme) => CodeBlockTheme;
7
+ export default getTheme;
@@ -0,0 +1,19 @@
1
+ import type { CSSObject } from '@emotion/core';
2
+ import type { Theme } from '@atlaskit/theme/types';
3
+ import type { CodeBlockTheme, CodeTheme } from './types';
4
+ export declare const getLineNumWidth: (numLines: number) => string;
5
+ /**
6
+ * Styles applied at the root element level, common across code/codeblock
7
+ */
8
+ export declare const getBaseCodeStyles: (theme: CodeTheme) => CSSObject;
9
+ /**
10
+ * Takes an implemented CodeBlock theme, and returns styles required for
11
+ * react-syntax-highlighter.
12
+ *
13
+ * @param theme
14
+ */
15
+ export declare const getCodeBlockStyles: (theme: CodeBlockTheme) => (highlightedStartText: string, highlightedEndText: string, hasLineNumbers?: boolean | undefined) => CSSObject;
16
+ export declare const getCodeStyles: (globalTheme: Theme | {
17
+ theme: Theme;
18
+ }) => CSSObject;
19
+ export declare const getCodeBlockTheme: (globalTheme: Theme, maxLines?: number | undefined) => CodeBlockTheme;
@@ -0,0 +1,57 @@
1
+ export interface CodeTheme {
2
+ backgroundColor?: string;
3
+ textColor?: string;
4
+ fontFamilyItalic?: string;
5
+ fontFamily?: string;
6
+ lineNumberColor?: string;
7
+ lineNumberBgColor?: string;
8
+ }
9
+ export interface CodeBlockTheme extends CodeTheme {
10
+ substringColor?: string;
11
+ keywordColor?: string;
12
+ attributeColor?: string;
13
+ selectorTagColor?: string;
14
+ docTagColor?: string;
15
+ nameColor?: string;
16
+ builtInColor?: string;
17
+ literalColor?: string;
18
+ bulletColor?: string;
19
+ codeColor?: string;
20
+ additionColor?: string;
21
+ regexpColor?: string;
22
+ symbolColor?: string;
23
+ variableColor?: string;
24
+ templateVariableColor?: string;
25
+ linkColor?: string;
26
+ selectorAttributeColor?: string;
27
+ selectorPseudoColor?: string;
28
+ typeColor?: string;
29
+ stringColor?: string;
30
+ selectorIdColor?: string;
31
+ selectorClassColor?: string;
32
+ quoteColor?: string;
33
+ templateTagColor?: string;
34
+ deletionColor?: string;
35
+ titleColor?: string;
36
+ sectionColor?: string;
37
+ commentColor?: string;
38
+ metaKeywordColor?: string;
39
+ metaColor?: string;
40
+ functionColor?: string;
41
+ numberColor?: string;
42
+ prologColor?: string;
43
+ cdataColor?: string;
44
+ punctuationColor?: string;
45
+ propertyColor?: string;
46
+ constantColor?: string;
47
+ deletedColor?: string;
48
+ booleanColor?: string;
49
+ charColor?: string;
50
+ insertedColor?: string;
51
+ operatorColor?: string;
52
+ atruleColor?: string;
53
+ importantColor?: string;
54
+ highlightedLineBgColor?: string;
55
+ highlightedLineBorderColor?: string;
56
+ lineNumberWidth?: string | number;
57
+ }
@@ -0,0 +1,57 @@
1
+ import type { SupportedLanguages } from '../constants';
2
+ export interface CodeBlockProps {
3
+ /**
4
+ * The code to be formatted
5
+ */
6
+ text: string;
7
+ /**
8
+ * A unique string that appears as a data attribute `data-testid`
9
+ * in the rendered code. Serves as a hook for automated tests.
10
+ */
11
+ testId?: string;
12
+ /**
13
+ * Whether to showLineNumbers or not, defaults to true
14
+ */
15
+ showLineNumbers?: boolean;
16
+ /**
17
+ * The language in which the code is written
18
+ */
19
+ language?: SupportedLanguages;
20
+ /**
21
+ * Lines to highlight comma delimited.
22
+ * Example uses:
23
+ * - To highlight one line `highlight="3"`
24
+ * - To highlight a group of lines `highlight="1-5"`
25
+ * - To highlight multiple groups `highlight="1-5,7,10,15-20"`
26
+ */
27
+ highlight?: string;
28
+ /**
29
+ * Screen reader text for the start of a highlighted line
30
+ */
31
+ highlightedStartText?: string;
32
+ /**
33
+ * Screen reader text for the end of a highlighted line
34
+ */
35
+ highlightedEndText?: string;
36
+ /**
37
+ * When false, disables decorating code with bidi warnings
38
+ *
39
+ * defaults to true
40
+ */
41
+ codeBidiWarnings?: boolean;
42
+ /**
43
+ * Labels for the previous and next buttons used in pagination.
44
+ * Defaults to `Bidirectional characters change the order that text is rendered. This could be used to obscure malicious code.`.
45
+ */
46
+ codeBidiWarningLabel?: string;
47
+ /**
48
+ * Defaults to enabled (true)
49
+ *
50
+ * Intended to be disabled when used in a mobile view, such as in the editor
51
+ * via mobile bridge, where the tooltip could end up being cut off of otherwise
52
+ * not work as expected.
53
+ */
54
+ codeBidiWarningTooltipEnabled?: boolean;
55
+ }
56
+ export type { SupportedLanguages, LanguageAlias, Language } from '../constants';
57
+ export type { CodeBlockTheme, CodeTheme } from './theme/types';
@@ -0,0 +1,2 @@
1
+ import { SupportedLanguages } from '../types';
2
+ export declare const normalizeLanguage: import("memoize-one").MemoizedFn<(language?: SupportedLanguages | undefined) => string>;
@@ -0,0 +1,9 @@
1
+ declare type CodeBidiWarningConfig = {
2
+ codeBidiWarningLabel?: string;
3
+ codeBidiWarningTooltipEnabled: boolean;
4
+ };
5
+ export declare function createBidiWarningRenderer(codeBidiWarningConfig: CodeBidiWarningConfig): ({ rows, stylesheet, useInlineStyles, }: any) => any;
6
+ export declare function createStyleObject(classNames: any, elementStyle: {} | undefined, stylesheet: any): any;
7
+ export declare function createClassNameString(classNames: any): any;
8
+ export declare function createChildren(stylesheet: any, useInlineStyles: any, codeBidiWarningConfig: any): (children: any) => any;
9
+ export {};
@@ -0,0 +1,32 @@
1
+ import type { HTMLProps, ReactNode } from 'react';
2
+ export type { SupportedLanguages, Language, LanguageAlias, CodeBlockProps, } from './internal/types';
3
+ export interface CodeProps extends HTMLProps<HTMLElement> {
4
+ /**
5
+ * A unique string that appears as a data attribute `data-testid`
6
+ * in the rendered code. Serves as a hook for automated tests.
7
+ */
8
+ testId?: string;
9
+ /**
10
+ * Content to be rendered in the inline code block
11
+ */
12
+ children?: ReactNode;
13
+ /**
14
+ * When false, disables decorating code with bidi warnings
15
+ *
16
+ * defaults to true
17
+ */
18
+ codeBidiWarnings?: boolean;
19
+ /**
20
+ * Labels for the previous and next buttons used in pagination.
21
+ * Defaults to `Bidirectional characters change the order that text is rendered. This could be used to obscure malicious code.`.
22
+ */
23
+ codeBidiWarningLabel?: string;
24
+ /**
25
+ * Defaults to enabled (true)
26
+ *
27
+ * Intended to be disabled when used in a mobile view, such as in the editor
28
+ * via mobile bridge, where the tooltip could end up being cut off of otherwise
29
+ * not work as expected.
30
+ */
31
+ codeBidiWarningTooltipEnabled?: boolean;
32
+ }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/entry-points/inline.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/inline.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/inline.d.ts"
7
+ "types": "../dist/types/entry-points/inline.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/entry-points/inline.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/code",
3
- "version": "14.3.9",
3
+ "version": "14.3.10",
4
4
  "description": "Code highlights short strings of code snippets inline with body text.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,6 +12,13 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
+ "typesVersions": {
16
+ ">=4.0 <4.5": {
17
+ "*": [
18
+ "dist/types-ts4.0/*"
19
+ ]
20
+ }
21
+ },
15
22
  "sideEffects": false,
16
23
  "atlaskit:src": "src/index.tsx",
17
24
  "atlassian": {
@@ -27,7 +34,7 @@
27
34
  },
28
35
  "dependencies": {
29
36
  "@atlaskit/codemod-utils": "^4.1.0",
30
- "@atlaskit/theme": "^12.1.0",
37
+ "@atlaskit/theme": "^12.2.0",
31
38
  "@atlaskit/tokens": "^0.10.0",
32
39
  "@atlaskit/tooltip": "^17.5.0",
33
40
  "@babel/runtime": "^7.0.0",
@@ -42,18 +49,19 @@
42
49
  "@atlaskit/button": "^16.3.0",
43
50
  "@atlaskit/docs": "^9.0.0",
44
51
  "@atlaskit/ds-lib": "^2.1.0",
45
- "@atlaskit/section-message": "^6.0.0",
52
+ "@atlaskit/section-message": "^6.2.0",
46
53
  "@atlaskit/ssr": "*",
47
54
  "@atlaskit/visual-regression": "*",
55
+ "@atlaskit/webdriver-runner": "*",
48
56
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
49
- "@testing-library/react": "^8.0.1",
57
+ "@testing-library/react": "^12.1.5",
50
58
  "@types/jscodeshift": "^0.11.0",
51
59
  "@types/react-syntax-highlighter": "^13.5.0",
52
60
  "color-contrast-checker": "^1.5.0",
53
61
  "jscodeshift": "^0.13.0",
54
62
  "prismjs": "^1.25.0",
55
63
  "react-dom": "^16.8.0",
56
- "typescript": "4.3.5"
64
+ "typescript": "4.5.5"
57
65
  },
58
66
  "keywords": [
59
67
  "atlaskit",
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/entry-points/types.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/types.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/types.d.ts"
7
+ "types": "../dist/types/entry-points/types.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/entry-points/types.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }