roamjs-components 0.87.0 → 0.88.1

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.
@@ -79,6 +79,6 @@ export declare type ArrayField = PagesField | MultiTextField | CustomField | Blo
79
79
  export declare type UnionField = ArrayField | TextField | TimeField | NumberField | OauthField | FlagField | SelectField | BlockField;
80
80
  export declare type Field<T extends UnionField> = Omit<T, "type"> & {
81
81
  title: string;
82
- description: string;
82
+ description: React.ReactNode;
83
83
  Panel: FieldPanel<T>;
84
84
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/ConfigPanels/types.ts"],"names":[],"mappings":"","sourcesContent":["import React from \"react\";\nimport type { InputTextNode } from \"../../types/native\";\nimport type { ExternalLoginOptions } from \"../ExternalLogin\";\n\nexport type OauthField = {\n type: \"oauth\";\n defaultValue?: [];\n options: ExternalLoginOptions;\n};\n\nexport type FieldPanel<T extends UnionField, U = Record<string, unknown>> = ((\n props: {\n order: number;\n uid?: string;\n parentUid: string;\n } & Omit<Field<T>, \"Panel\"> &\n U\n) => React.ReactElement) & { type: T[\"type\"] };\n\nexport type TextField = {\n type: \"text\";\n defaultValue?: string;\n options?: {\n placeholder?: string;\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void\n };\n};\n\nexport type TimeField = {\n type: \"time\";\n defaultValue?: Date;\n};\n\nexport type NumberField = {\n type: \"number\";\n defaultValue?: number;\n};\n\nexport type FlagField = {\n type: \"flag\";\n defaultValue?: boolean;\n disabled?: boolean;\n options?: {\n onChange?: (f: boolean, e: React.FormEvent<HTMLInputElement>) => void;\n };\n};\n\nexport type MultiTextField = {\n type: \"multitext\";\n defaultValue?: string[];\n options?: {\n placeholder?: string;\n };\n};\n\nexport type PagesField = {\n type: \"pages\";\n defaultValue?: string[];\n};\n\nexport type SelectField = {\n type: \"select\";\n defaultValue?: string;\n options: {\n items: string[] | (() => string[]);\n };\n};\n\nexport type BlockField = {\n type: \"block\";\n defaultValue?: InputTextNode;\n};\n\nexport type BlocksField = {\n type: \"blocks\";\n defaultValue?: InputTextNode[];\n};\n\nexport type CustomField = {\n type: \"custom\";\n defaultValue?: InputTextNode[];\n options: {\n component: React.FC<{\n parentUid: string;\n uid: string;\n defaultValue: InputTextNode[];\n title: string;\n }>;\n };\n};\n\nexport type ArrayField =\n | PagesField\n | MultiTextField\n | CustomField\n | BlocksField;\nexport type UnionField =\n | ArrayField\n | TextField\n | TimeField\n | NumberField\n | OauthField\n | FlagField\n | SelectField\n | BlockField;\n\nexport type Field<T extends UnionField> = Omit<T, \"type\"> & {\n title: string;\n description: string;\n Panel: FieldPanel<T>;\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/ConfigPanels/types.ts"],"names":[],"mappings":"","sourcesContent":["import React from \"react\";\nimport type { InputTextNode } from \"../../types/native\";\nimport type { ExternalLoginOptions } from \"../ExternalLogin\";\n\nexport type OauthField = {\n type: \"oauth\";\n defaultValue?: [];\n options: ExternalLoginOptions;\n};\n\nexport type FieldPanel<T extends UnionField, U = Record<string, unknown>> = ((\n props: {\n order: number;\n uid?: string;\n parentUid: string;\n } & Omit<Field<T>, \"Panel\"> &\n U\n) => React.ReactElement) & { type: T[\"type\"] };\n\nexport type TextField = {\n type: \"text\";\n defaultValue?: string;\n options?: {\n placeholder?: string;\n onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void\n };\n};\n\nexport type TimeField = {\n type: \"time\";\n defaultValue?: Date;\n};\n\nexport type NumberField = {\n type: \"number\";\n defaultValue?: number;\n};\n\nexport type FlagField = {\n type: \"flag\";\n defaultValue?: boolean;\n disabled?: boolean;\n options?: {\n onChange?: (f: boolean, e: React.FormEvent<HTMLInputElement>) => void;\n };\n};\n\nexport type MultiTextField = {\n type: \"multitext\";\n defaultValue?: string[];\n options?: {\n placeholder?: string;\n };\n};\n\nexport type PagesField = {\n type: \"pages\";\n defaultValue?: string[];\n};\n\nexport type SelectField = {\n type: \"select\";\n defaultValue?: string;\n options: {\n items: string[] | (() => string[]);\n };\n};\n\nexport type BlockField = {\n type: \"block\";\n defaultValue?: InputTextNode;\n};\n\nexport type BlocksField = {\n type: \"blocks\";\n defaultValue?: InputTextNode[];\n};\n\nexport type CustomField = {\n type: \"custom\";\n defaultValue?: InputTextNode[];\n options: {\n component: React.FC<{\n parentUid: string;\n uid: string;\n defaultValue: InputTextNode[];\n title: string;\n }>;\n };\n};\n\nexport type ArrayField =\n | PagesField\n | MultiTextField\n | CustomField\n | BlocksField;\nexport type UnionField =\n | ArrayField\n | TextField\n | TimeField\n | NumberField\n | OauthField\n | FlagField\n | SelectField\n | BlockField;\n\nexport type Field<T extends UnionField> = Omit<T, \"type\"> & {\n title: string;\n description: React.ReactNode;\n Panel: FieldPanel<T>;\n};\n"]}
@@ -1,5 +1,9 @@
1
+ import { Tooltip } from "@blueprintjs/core";
1
2
  import React from "react";
2
- declare const Description: ({ description, }: {
3
- description: string;
4
- }) => React.ReactElement;
3
+ declare type TooltipInteractionKind = React.ComponentProps<typeof Tooltip>["interactionKind"];
4
+ declare type DescriptionProps = {
5
+ description: React.ReactNode;
6
+ interactionKind?: TooltipInteractionKind;
7
+ };
8
+ declare const Description: ({ description, interactionKind, }: DescriptionProps) => React.ReactElement;
5
9
  export default Description;
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const core_1 = require("@blueprintjs/core");
5
5
  const react_1 = tslib_1.__importDefault(require("react"));
6
- const Description = ({ description, }) => {
6
+ const Description = ({ description, interactionKind = core_1.PopoverInteractionKind.HOVER_TARGET_ONLY, }) => {
7
7
  return (react_1.default.createElement("span", { style: {
8
8
  marginLeft: 12,
9
9
  display: "inline-block",
10
10
  opacity: 0.8,
11
11
  verticalAlign: "text-bottom",
12
12
  } },
13
- react_1.default.createElement(core_1.Tooltip, { content: react_1.default.createElement("span", { style: { maxWidth: 400, display: "inline-block" } }, description) },
13
+ react_1.default.createElement(core_1.Tooltip, { interactionKind: interactionKind, content: react_1.default.createElement("span", { style: { maxWidth: 400, display: "inline-block" } }, description) },
14
14
  react_1.default.createElement(core_1.Icon, { icon: "info-sign", iconSize: 12 }))));
15
15
  };
16
16
  exports.default = Description;
@@ -1 +1 @@
1
- {"version":3,"file":"Description.js","sourceRoot":"","sources":["../../src/components/Description.tsx"],"names":[],"mappings":";;;AAAA,4CAAkD;AAClD,0DAA0B;AAE1B,MAAM,WAAW,GAAG,CAAC,EACnB,WAAW,GAGZ,EAAsB,EAAE;IACvB,OAAO,CACL,wCACE,KAAK,EAAE;YACL,UAAU,EAAE,EAAE;YACd,OAAO,EAAE,cAAc;YACvB,OAAO,EAAE,GAAG;YACZ,aAAa,EAAE,aAAa;SAC7B;QAED,8BAAC,cAAO,IACN,OAAO,EACL,wCAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,IACpD,WAAW,CACP;YAGT,8BAAC,WAAI,IAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,GAAI,CACjC,CACL,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC","sourcesContent":["import { Tooltip, Icon } from \"@blueprintjs/core\";\nimport React from \"react\";\n\nconst Description = ({\n description,\n}: {\n description: string;\n}): React.ReactElement => {\n return (\n <span\n style={{\n marginLeft: 12,\n display: \"inline-block\",\n opacity: 0.8,\n verticalAlign: \"text-bottom\",\n }}\n >\n <Tooltip\n content={\n <span style={{ maxWidth: 400, display: \"inline-block\" }}>\n {description}\n </span>\n }\n >\n <Icon icon={\"info-sign\"} iconSize={12} />\n </Tooltip>\n </span>\n );\n};\n\nexport default Description;\n"]}
1
+ {"version":3,"file":"Description.js","sourceRoot":"","sources":["../../src/components/Description.tsx"],"names":[],"mappings":";;;AAAA,4CAA0E;AAC1E,0DAA0B;AAW1B,MAAM,WAAW,GAAG,CAAC,EACnB,WAAW,EACX,eAAe,GAAG,6BAAsB,CAAC,iBAAiB,GACzC,EAAsB,EAAE;IACzC,OAAO,CACL,wCACE,KAAK,EAAE;YACL,UAAU,EAAE,EAAE;YACd,OAAO,EAAE,cAAc;YACvB,OAAO,EAAE,GAAG;YACZ,aAAa,EAAE,aAAa;SAC7B;QAED,8BAAC,cAAO,IACN,eAAe,EAAE,eAAe,EAChC,OAAO,EACL,wCAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,IACpD,WAAW,CACP;YAGT,8BAAC,WAAI,IAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,GAAI,CACjC,CACL,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC","sourcesContent":["import { Tooltip, Icon, PopoverInteractionKind } from \"@blueprintjs/core\";\nimport React from \"react\";\n\ntype TooltipInteractionKind = React.ComponentProps<\n typeof Tooltip\n>[\"interactionKind\"];\n\ntype DescriptionProps = {\n description: React.ReactNode;\n interactionKind?: TooltipInteractionKind;\n};\n\nconst Description = ({\n description,\n interactionKind = PopoverInteractionKind.HOVER_TARGET_ONLY,\n}: DescriptionProps): React.ReactElement => {\n return (\n <span\n style={{\n marginLeft: 12,\n display: \"inline-block\",\n opacity: 0.8,\n verticalAlign: \"text-bottom\",\n }}\n >\n <Tooltip\n interactionKind={interactionKind}\n content={\n <span style={{ maxWidth: 400, display: \"inline-block\" }}>\n {description}\n </span>\n }\n >\n <Icon icon={\"info-sign\"} iconSize={12} />\n </Tooltip>\n </span>\n );\n};\n\nexport default Description;\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "roamjs-components",
3
3
  "description": "Expansive toolset, utilities, & components for developing RoamJS extensions.",
4
- "version": "0.87.0",
4
+ "version": "0.88.1",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {