@mittwald/flow-react-components 0.2.0-alpha.886 → 0.2.0-alpha.887

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.
@@ -34,6 +34,8 @@ const CodeEditor = flowComponent("CodeEditor", (props) => {
34
34
  showLinterMarkers = true,
35
35
  showActiveLineMarker = true,
36
36
  copyable = true,
37
+ height,
38
+ minHeight,
37
39
  ...rest
38
40
  } = useControlledHostValueProps(props);
39
41
  const {
@@ -81,6 +83,7 @@ const CodeEditor = flowComponent("CodeEditor", (props) => {
81
83
  }
82
84
  },
83
85
  extensions: enabledExtensions,
86
+ height: height ?? minHeight,
84
87
  children: copyable && /* @__PURE__ */ jsx(
85
88
  CopyButton,
86
89
  {
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditor.mjs","sources":["../../../../../../../src/components/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import type { ReactCodeMirrorProps } from \"@uiw/react-codemirror\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./CodeEditor.module.scss\";\nimport { type CodeEditorLanguage } from \"@/components/CodeEditor/languages\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\nimport { useObjectRef } from \"react-aria\";\nimport { defaultLightTheme } from \"@/components/CodeEditor/themes/defaultEditorTheme\";\nimport {\n type CodeEditorSetup,\n useCodeEditorExtensions,\n} from \"@/components/CodeEditor/hooks/useCodeEditorExtensions\";\nimport { CopyButton } from \"@/components/CopyButton\";\n\nexport interface CodeEditorProps\n extends\n Omit<ReactCodeMirrorProps, \"theme\" | \"lang\" | \"basicSetup\" | \"readOnly\">,\n CodeEditorSetup,\n FlowComponentProps {\n defaultValue?: string;\n isReadOnly?: boolean;\n isInvalid?: boolean;\n className?: string;\n language?: CodeEditorLanguage;\n copyable?: boolean;\n isRequired?: boolean;\n validationBehavior?: unknown;\n}\n\n/** @flr-generate all */\nexport const CodeEditor = flowComponent(\"CodeEditor\", (props) => {\n const {\n ref,\n children,\n className,\n language,\n extensions,\n isReadOnly,\n isInvalid,\n isRequired,\n validationBehavior: _ignoredValidationBehavior,\n value,\n showLineNumbers = true,\n showCodeFolding = true,\n showCodeIndentationMakers = true,\n showLinterMarkers = true,\n showActiveLineMarker = true,\n copyable = true,\n ...rest\n } = useControlledHostValueProps(props);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"CodeEditor\");\n\n const rootClassName = clsx(\n fieldProps.className,\n styles.codeEditor,\n className,\n );\n\n const enabledExtensions = useCodeEditorExtensions(language, extensions, {\n showLineNumbers: showLineNumbers,\n showCodeIndentationMakers: showCodeIndentationMakers,\n showCodeFolding: showCodeFolding,\n showLinterMarkers: showLinterMarkers,\n });\n\n const localRef = useObjectRef(ref);\n\n useMakeFocusable(localRef);\n\n return (\n <div className={rootClassName}>\n <PropsContextProvider props={fieldPropsContext}>\n <FieldErrorCaptureContext>\n <CodeMirror\n {...rest}\n value={value}\n basicSetup={{\n highlightActiveLine: showActiveLineMarker,\n highlightActiveLineGutter: showActiveLineMarker,\n autocompletion: false,\n lineNumbers: false,\n foldGutter: false,\n highlightSelectionMatches: false,\n }}\n theme={defaultLightTheme}\n aria-required={isRequired}\n aria-invalid={isInvalid}\n readOnly={isReadOnly}\n className={clsx(styles.codeMirror, isReadOnly && styles.readonly)}\n ref={(codeMirrorRef) => {\n if (codeMirrorRef?.editor) {\n localRef.current = codeMirrorRef.editor;\n }\n }}\n extensions={enabledExtensions}\n >\n {copyable && (\n <CopyButton\n className={styles.copyButton}\n size=\"s\"\n variant=\"soft\"\n text={value}\n />\n )}\n </CodeMirror>\n {children}\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </PropsContextProvider>\n </div>\n );\n});\n\nexport default CodeEditor;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAqCO,MAAM,UAAA,GAAa,aAAA,CAAc,YAAA,EAAc,CAAC,KAAA,KAAU;AAC/D,EAAA,MAAM;AAAA,IACJ,GAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,kBAAA,EAAoB,0BAAA;AAAA,IACpB,KAAA;AAAA,IACA,eAAA,GAAkB,IAAA;AAAA,IAClB,eAAA,GAAkB,IAAA;AAAA,IAClB,yBAAA,GAA4B,IAAA;AAAA,IAC5B,iBAAA,GAAoB,IAAA;AAAA,IACpB,oBAAA,GAAuB,IAAA;AAAA,IACvB,QAAA,GAAW,IAAA;AAAA,IACX,GAAG;AAAA,GACL,GAAI,4BAA4B,KAAK,CAAA;AAErC,EAAA,MAAM;AAAA,IACJ,cAAA;AAAA,IACA,wBAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF,GAAI,iBAAA,CAAkB,KAAA,EAAO,YAAY,CAAA;AAEzC,EAAA,MAAM,aAAA,GAAgB,IAAA;AAAA,IACpB,UAAA,CAAW,SAAA;AAAA,IACX,MAAA,CAAO,UAAA;AAAA,IACP;AAAA,GACF;AAEA,EAAA,MAAM,iBAAA,GAAoB,uBAAA,CAAwB,QAAA,EAAU,UAAA,EAAY;AAAA,IACtE,eAAA;AAAA,IACA,yBAAA;AAAA,IACA,eAAA;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,MAAM,QAAA,GAAW,aAAa,GAAG,CAAA;AAEjC,EAAA,gBAAA,CAAiB,QAAQ,CAAA;AAEzB,EAAA,2BACG,KAAA,EAAA,EAAI,SAAA,EAAW,eACd,QAAA,kBAAA,IAAA,CAAC,oBAAA,EAAA,EAAqB,OAAO,iBAAA,EAC3B,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAC,wBAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAA,GAAA;AAAA,QAAC,UAAA;AAAA,QAAA;AAAA,UACE,GAAG,IAAA;AAAA,UACJ,KAAA;AAAA,UACA,UAAA,EAAY;AAAA,YACV,mBAAA,EAAqB,oBAAA;AAAA,YACrB,yBAAA,EAA2B,oBAAA;AAAA,YAC3B,cAAA,EAAgB,KAAA;AAAA,YAChB,WAAA,EAAa,KAAA;AAAA,YACb,UAAA,EAAY,KAAA;AAAA,YACZ,yBAAA,EAA2B;AAAA,WAC7B;AAAA,UACA,KAAA,EAAO,iBAAA;AAAA,UACP,eAAA,EAAe,UAAA;AAAA,UACf,cAAA,EAAc,SAAA;AAAA,UACd,QAAA,EAAU,UAAA;AAAA,UACV,WAAW,IAAA,CAAK,MAAA,CAAO,UAAA,EAAY,UAAA,IAAc,OAAO,QAAQ,CAAA;AAAA,UAChE,GAAA,EAAK,CAAC,aAAA,KAAkB;AACtB,YAAA,IAAI,eAAe,MAAA,EAAQ;AACzB,cAAA,QAAA,CAAS,UAAU,aAAA,CAAc,MAAA;AAAA,YACnC;AAAA,UACF,CAAA;AAAA,UACA,UAAA,EAAY,iBAAA;AAAA,UAEX,QAAA,EAAA,QAAA,oBACC,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,WAAW,MAAA,CAAO,UAAA;AAAA,cAClB,IAAA,EAAK,GAAA;AAAA,cACL,OAAA,EAAQ,MAAA;AAAA,cACR,IAAA,EAAM;AAAA;AAAA;AACR;AAAA,OAEJ;AAAA,MACC;AAAA,KAAA,EACH,CAAA;AAAA,wBACC,cAAA,EAAA,EAAe;AAAA,GAAA,EAClB,CAAA,EACF,CAAA;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"CodeEditor.mjs","sources":["../../../../../../../src/components/CodeEditor/CodeEditor.tsx"],"sourcesContent":["import type { ReactCodeMirrorProps } from \"@uiw/react-codemirror\";\nimport CodeMirror from \"@uiw/react-codemirror\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport styles from \"./CodeEditor.module.scss\";\nimport { type CodeEditorLanguage } from \"@/components/CodeEditor/languages\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\nimport { useObjectRef } from \"react-aria\";\nimport { defaultLightTheme } from \"@/components/CodeEditor/themes/defaultEditorTheme\";\nimport {\n type CodeEditorSetup,\n useCodeEditorExtensions,\n} from \"@/components/CodeEditor/hooks/useCodeEditorExtensions\";\nimport { CopyButton } from \"@/components/CopyButton\";\n\nexport interface CodeEditorProps\n extends\n Omit<ReactCodeMirrorProps, \"theme\" | \"lang\" | \"basicSetup\" | \"readOnly\">,\n CodeEditorSetup,\n FlowComponentProps {\n defaultValue?: string;\n isReadOnly?: boolean;\n isInvalid?: boolean;\n className?: string;\n language?: CodeEditorLanguage;\n copyable?: boolean;\n isRequired?: boolean;\n validationBehavior?: unknown;\n}\n\n/** @flr-generate all */\nexport const CodeEditor = flowComponent(\"CodeEditor\", (props) => {\n const {\n ref,\n children,\n className,\n language,\n extensions,\n isReadOnly,\n isInvalid,\n isRequired,\n validationBehavior: _ignoredValidationBehavior,\n value,\n showLineNumbers = true,\n showCodeFolding = true,\n showCodeIndentationMakers = true,\n showLinterMarkers = true,\n showActiveLineMarker = true,\n copyable = true,\n height,\n minHeight,\n ...rest\n } = useControlledHostValueProps(props);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"CodeEditor\");\n\n const rootClassName = clsx(\n fieldProps.className,\n styles.codeEditor,\n className,\n );\n\n const enabledExtensions = useCodeEditorExtensions(language, extensions, {\n showLineNumbers: showLineNumbers,\n showCodeIndentationMakers: showCodeIndentationMakers,\n showCodeFolding: showCodeFolding,\n showLinterMarkers: showLinterMarkers,\n });\n\n const localRef = useObjectRef(ref);\n\n useMakeFocusable(localRef);\n\n return (\n <div className={rootClassName}>\n <PropsContextProvider props={fieldPropsContext}>\n <FieldErrorCaptureContext>\n <CodeMirror\n {...rest}\n value={value}\n basicSetup={{\n highlightActiveLine: showActiveLineMarker,\n highlightActiveLineGutter: showActiveLineMarker,\n autocompletion: false,\n lineNumbers: false,\n foldGutter: false,\n highlightSelectionMatches: false,\n }}\n theme={defaultLightTheme}\n aria-required={isRequired}\n aria-invalid={isInvalid}\n readOnly={isReadOnly}\n className={clsx(styles.codeMirror, isReadOnly && styles.readonly)}\n ref={(codeMirrorRef) => {\n if (codeMirrorRef?.editor) {\n localRef.current = codeMirrorRef.editor;\n }\n }}\n extensions={enabledExtensions}\n height={height ?? minHeight}\n >\n {copyable && (\n <CopyButton\n className={styles.copyButton}\n size=\"s\"\n variant=\"soft\"\n text={value}\n />\n )}\n </CodeMirror>\n {children}\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </PropsContextProvider>\n </div>\n );\n});\n\nexport default CodeEditor;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAqCO,MAAM,UAAA,GAAa,aAAA,CAAc,YAAA,EAAc,CAAC,KAAA,KAAU;AAC/D,EAAA,MAAM;AAAA,IACJ,GAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,kBAAA,EAAoB,0BAAA;AAAA,IACpB,KAAA;AAAA,IACA,eAAA,GAAkB,IAAA;AAAA,IAClB,eAAA,GAAkB,IAAA;AAAA,IAClB,yBAAA,GAA4B,IAAA;AAAA,IAC5B,iBAAA,GAAoB,IAAA;AAAA,IACpB,oBAAA,GAAuB,IA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,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAwB;AACxB,eAAO,MAAM,UAAU,oGAuFrB,CAAC;AAEH,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,sCAAsC,CAAC;AAM9C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAI5E,OAAO,EACL,KAAK,eAAe,EAErB,MAAM,uDAAuD,CAAC;AAG/D,MAAM,WAAW,eACf,SACE,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC,EACxE,eAAe,EACf,kBAAkB;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAwB;AACxB,eAAO,MAAM,UAAU,oGA0FrB,CAAC;AAEH,eAAe,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.2.0-alpha.886",
3
+ "version": "0.2.0-alpha.887",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -63,9 +63,9 @@
63
63
  "@internationalized/string": "^3.2.9",
64
64
  "@internationalized/string-compiler": "^3.4.1",
65
65
  "@lezer/highlight": "^1.2.3",
66
- "@mittwald/flow-icons": "0.2.0-alpha.886",
66
+ "@mittwald/flow-icons": "0.2.0-alpha.887",
67
67
  "@mittwald/password-tools-js": "3.0.0-alpha.30",
68
- "@mittwald/react-tunnel": "0.2.0-alpha.886",
68
+ "@mittwald/react-tunnel": "0.2.0-alpha.887",
69
69
  "@mittwald/react-use-promise": "^4.2.2",
70
70
  "@react-aria/form": "^3.2.1",
71
71
  "@react-aria/i18n": "^3.13.1",
@@ -120,7 +120,7 @@
120
120
  "@lezer/generator": "^1.8.0",
121
121
  "@lezer/lr": "^1.4.10",
122
122
  "@mittwald/flow-core": "",
123
- "@mittwald/flow-design-tokens": "0.2.0-alpha.886",
123
+ "@mittwald/flow-design-tokens": "0.2.0-alpha.887",
124
124
  "@mittwald/flow-icons-base": "",
125
125
  "@mittwald/react-use-promise": "^4.2.2",
126
126
  "@mittwald/remote-dom-react": "1.2.2-mittwald.10",
@@ -175,7 +175,7 @@
175
175
  },
176
176
  "peerDependencies": {
177
177
  "@internationalized/date": "^3.12.2",
178
- "@mittwald/flow-icons-pro": "0.2.0-alpha.885",
178
+ "@mittwald/flow-icons-pro": "0.2.0-alpha.886",
179
179
  "@mittwald/react-use-promise": "^4.2.2",
180
180
  "next": "^16.2.3",
181
181
  "react": "^19.2.0",
@@ -196,5 +196,5 @@
196
196
  "optional": true
197
197
  }
198
198
  },
199
- "gitHead": "8749dad12785c668bbc6aecb67e98528977ac701"
199
+ "gitHead": "118e5841fc7cec5e56b31ba42b90ad9c14fdcfd1"
200
200
  }