@trycourier/react-designer 0.0.0-canary-20251207101348 → 0.0.0-canary-20251208142108

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.
@@ -1015,10 +1015,6 @@ body {
1015
1015
  .courier-m-6 {
1016
1016
  margin: 1.5rem;
1017
1017
  }
1018
- .\!courier-my-1 {
1019
- margin-top: 0.25rem !important;
1020
- margin-bottom: 0.25rem !important;
1021
- }
1022
1018
  .-courier-mx-4 {
1023
1019
  margin-left: -1rem;
1024
1020
  margin-right: -1rem;
@@ -1232,9 +1228,6 @@ body {
1232
1228
  .courier-h-\[1px\] {
1233
1229
  height: 1px;
1234
1230
  }
1235
- .courier-h-\[25px\] {
1236
- height: 25px;
1237
- }
1238
1231
  .courier-h-\[300px\] {
1239
1232
  height: 300px;
1240
1233
  }
@@ -1277,9 +1270,6 @@ body {
1277
1270
  .courier-min-h-\[120px\] {
1278
1271
  min-height: 120px;
1279
1272
  }
1280
- .courier-min-h-\[20px\] {
1281
- min-height: 20px;
1282
- }
1283
1273
  .courier-min-h-\[44px\] {
1284
1274
  min-height: 44px;
1285
1275
  }
@@ -1686,6 +1676,9 @@ body {
1686
1676
  .courier-border-dotted {
1687
1677
  border-style: dotted;
1688
1678
  }
1679
+ .\!courier-border-none {
1680
+ border-style: none !important;
1681
+ }
1689
1682
  .courier-border-none {
1690
1683
  border-style: none;
1691
1684
  }
@@ -2058,9 +2051,6 @@ body {
2058
2051
  .courier-pb-0 {
2059
2052
  padding-bottom: 0px;
2060
2053
  }
2061
- .courier-pb-1 {
2062
- padding-bottom: 0.25rem;
2063
- }
2064
2054
  .courier-pb-2 {
2065
2055
  padding-bottom: 0.5rem;
2066
2056
  }
@@ -2073,9 +2063,6 @@ body {
2073
2063
  .courier-pb-6 {
2074
2064
  padding-bottom: 1.5rem;
2075
2065
  }
2076
- .courier-pb-px {
2077
- padding-bottom: 1px;
2078
- }
2079
2066
  .courier-pl-0 {
2080
2067
  padding-left: 0px;
2081
2068
  }
@@ -2197,9 +2184,6 @@ body {
2197
2184
  .courier-leading-none {
2198
2185
  line-height: 1;
2199
2186
  }
2200
- .courier-leading-normal {
2201
- line-height: 1.5;
2202
- }
2203
2187
  .courier-leading-relaxed {
2204
2188
  line-height: 1.625;
2205
2189
  }
@@ -4348,24 +4332,6 @@ body {
4348
4332
  font-size: 0.8rem;
4349
4333
  padding: 0;
4350
4334
  }
4351
- /* Variable Textarea placeholder styles */
4352
- .variable-textarea-placeholder .ProseMirror p.is-editor-empty:first-child::before,
4353
- .variable-textarea-placeholder .ProseMirror p.is-empty:first-child::before {
4354
- content: attr(data-placeholder);
4355
- float: left;
4356
- color: var(--muted-foreground);
4357
- pointer-events: none;
4358
- height: 0;
4359
- }
4360
- /* Variable Input placeholder styles */
4361
- .variable-input-placeholder .ProseMirror p.is-editor-empty:first-child::before,
4362
- .variable-input-placeholder .ProseMirror p.is-empty:first-child::before {
4363
- content: attr(data-placeholder);
4364
- float: left;
4365
- color: var(--muted-foreground);
4366
- pointer-events: none;
4367
- height: 0;
4368
- }
4369
4335
  .file\:courier-border-0::file-selector-button {
4370
4336
  border-width: 0px;
4371
4337
  }
@@ -4400,6 +4366,12 @@ body {
4400
4366
  .last\:courier-mt-0:last-child {
4401
4367
  margin-top: 0px;
4402
4368
  }
4369
+ .read-only\:courier-cursor-default:read-only {
4370
+ cursor: default;
4371
+ }
4372
+ .read-only\:courier-border-transparent:read-only {
4373
+ border-color: transparent;
4374
+ }
4403
4375
  .hover\:courier-border-accent-foreground:hover {
4404
4376
  border-color: var(--accent-foreground);
4405
4377
  }
@@ -4839,38 +4811,6 @@ body {
4839
4811
  .\[\&\>svg\]\:courier-shrink-0>svg {
4840
4812
  flex-shrink: 0;
4841
4813
  }
4842
- .\[\&_\.ProseMirror\]\:courier-flex .ProseMirror {
4843
- display: flex;
4844
- }
4845
- .\[\&_\.ProseMirror\]\:courier-h-\[25px\] .ProseMirror {
4846
- height: 25px;
4847
- }
4848
- .\[\&_\.ProseMirror\]\:courier-min-h-\[20px\] .ProseMirror {
4849
- min-height: 20px;
4850
- }
4851
- .\[\&_\.ProseMirror\]\:courier-flex-1 .ProseMirror {
4852
- flex: 1 1 0%;
4853
- }
4854
- .\[\&_\.ProseMirror\]\:courier-items-end .ProseMirror {
4855
- align-items: flex-end;
4856
- }
4857
- .\[\&_\.ProseMirror\]\:courier-border-none .ProseMirror {
4858
- border-style: none;
4859
- }
4860
- .\[\&_\.ProseMirror\]\:courier-p-0 .ProseMirror {
4861
- padding: 0px;
4862
- }
4863
- .\[\&_\.ProseMirror\]\:courier-outline-none .ProseMirror {
4864
- outline: 2px solid transparent;
4865
- outline-offset: 2px;
4866
- }
4867
- .\[\&_\.tiptap\]\:courier-border-none .tiptap {
4868
- border-style: none;
4869
- }
4870
- .\[\&_\.tiptap\]\:courier-outline-none .tiptap {
4871
- outline: 2px solid transparent;
4872
- outline-offset: 2px;
4873
- }
4874
4814
  .\[\&_svg\]\:courier-pointer-events-none svg {
4875
4815
  pointer-events: none;
4876
4816
  }
package/dist/styles.css CHANGED
@@ -1015,10 +1015,6 @@ body {
1015
1015
  .courier-m-6 {
1016
1016
  margin: 1.5rem;
1017
1017
  }
1018
- .\!courier-my-1 {
1019
- margin-top: 0.25rem !important;
1020
- margin-bottom: 0.25rem !important;
1021
- }
1022
1018
  .-courier-mx-4 {
1023
1019
  margin-left: -1rem;
1024
1020
  margin-right: -1rem;
@@ -1232,9 +1228,6 @@ body {
1232
1228
  .courier-h-\[1px\] {
1233
1229
  height: 1px;
1234
1230
  }
1235
- .courier-h-\[25px\] {
1236
- height: 25px;
1237
- }
1238
1231
  .courier-h-\[300px\] {
1239
1232
  height: 300px;
1240
1233
  }
@@ -1277,9 +1270,6 @@ body {
1277
1270
  .courier-min-h-\[120px\] {
1278
1271
  min-height: 120px;
1279
1272
  }
1280
- .courier-min-h-\[20px\] {
1281
- min-height: 20px;
1282
- }
1283
1273
  .courier-min-h-\[44px\] {
1284
1274
  min-height: 44px;
1285
1275
  }
@@ -1686,6 +1676,9 @@ body {
1686
1676
  .courier-border-dotted {
1687
1677
  border-style: dotted;
1688
1678
  }
1679
+ .\!courier-border-none {
1680
+ border-style: none !important;
1681
+ }
1689
1682
  .courier-border-none {
1690
1683
  border-style: none;
1691
1684
  }
@@ -2058,9 +2051,6 @@ body {
2058
2051
  .courier-pb-0 {
2059
2052
  padding-bottom: 0px;
2060
2053
  }
2061
- .courier-pb-1 {
2062
- padding-bottom: 0.25rem;
2063
- }
2064
2054
  .courier-pb-2 {
2065
2055
  padding-bottom: 0.5rem;
2066
2056
  }
@@ -2073,9 +2063,6 @@ body {
2073
2063
  .courier-pb-6 {
2074
2064
  padding-bottom: 1.5rem;
2075
2065
  }
2076
- .courier-pb-px {
2077
- padding-bottom: 1px;
2078
- }
2079
2066
  .courier-pl-0 {
2080
2067
  padding-left: 0px;
2081
2068
  }
@@ -2197,9 +2184,6 @@ body {
2197
2184
  .courier-leading-none {
2198
2185
  line-height: 1;
2199
2186
  }
2200
- .courier-leading-normal {
2201
- line-height: 1.5;
2202
- }
2203
2187
  .courier-leading-relaxed {
2204
2188
  line-height: 1.625;
2205
2189
  }
@@ -4348,24 +4332,6 @@ body {
4348
4332
  font-size: 0.8rem;
4349
4333
  padding: 0;
4350
4334
  }
4351
- /* Variable Textarea placeholder styles */
4352
- .variable-textarea-placeholder .ProseMirror p.is-editor-empty:first-child::before,
4353
- .variable-textarea-placeholder .ProseMirror p.is-empty:first-child::before {
4354
- content: attr(data-placeholder);
4355
- float: left;
4356
- color: var(--muted-foreground);
4357
- pointer-events: none;
4358
- height: 0;
4359
- }
4360
- /* Variable Input placeholder styles */
4361
- .variable-input-placeholder .ProseMirror p.is-editor-empty:first-child::before,
4362
- .variable-input-placeholder .ProseMirror p.is-empty:first-child::before {
4363
- content: attr(data-placeholder);
4364
- float: left;
4365
- color: var(--muted-foreground);
4366
- pointer-events: none;
4367
- height: 0;
4368
- }
4369
4335
  .file\:courier-border-0::file-selector-button {
4370
4336
  border-width: 0px;
4371
4337
  }
@@ -4400,6 +4366,12 @@ body {
4400
4366
  .last\:courier-mt-0:last-child {
4401
4367
  margin-top: 0px;
4402
4368
  }
4369
+ .read-only\:courier-cursor-default:read-only {
4370
+ cursor: default;
4371
+ }
4372
+ .read-only\:courier-border-transparent:read-only {
4373
+ border-color: transparent;
4374
+ }
4403
4375
  .hover\:courier-border-accent-foreground:hover {
4404
4376
  border-color: var(--accent-foreground);
4405
4377
  }
@@ -4839,38 +4811,6 @@ body {
4839
4811
  .\[\&\>svg\]\:courier-shrink-0>svg {
4840
4812
  flex-shrink: 0;
4841
4813
  }
4842
- .\[\&_\.ProseMirror\]\:courier-flex .ProseMirror {
4843
- display: flex;
4844
- }
4845
- .\[\&_\.ProseMirror\]\:courier-h-\[25px\] .ProseMirror {
4846
- height: 25px;
4847
- }
4848
- .\[\&_\.ProseMirror\]\:courier-min-h-\[20px\] .ProseMirror {
4849
- min-height: 20px;
4850
- }
4851
- .\[\&_\.ProseMirror\]\:courier-flex-1 .ProseMirror {
4852
- flex: 1 1 0%;
4853
- }
4854
- .\[\&_\.ProseMirror\]\:courier-items-end .ProseMirror {
4855
- align-items: flex-end;
4856
- }
4857
- .\[\&_\.ProseMirror\]\:courier-border-none .ProseMirror {
4858
- border-style: none;
4859
- }
4860
- .\[\&_\.ProseMirror\]\:courier-p-0 .ProseMirror {
4861
- padding: 0px;
4862
- }
4863
- .\[\&_\.ProseMirror\]\:courier-outline-none .ProseMirror {
4864
- outline: 2px solid transparent;
4865
- outline-offset: 2px;
4866
- }
4867
- .\[\&_\.tiptap\]\:courier-border-none .tiptap {
4868
- border-style: none;
4869
- }
4870
- .\[\&_\.tiptap\]\:courier-outline-none .tiptap {
4871
- outline: 2px solid transparent;
4872
- outline-offset: 2px;
4873
- }
4874
4814
  .\[\&_svg\]\:courier-pointer-events-none svg {
4875
4815
  pointer-events: none;
4876
4816
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycourier/react-designer",
3
- "version": "0.0.0-canary-20251207101348",
3
+ "version": "0.0.0-canary-20251208142108",
4
4
  "description": "React-based rich text designer component",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -1,11 +0,0 @@
1
- import * as React from "react";
2
- import { type VariableEditorBaseProps } from "./shared";
3
- export interface VariableInputProps extends VariableEditorBaseProps {
4
- /** Whether the input is read-only */
5
- readOnly?: boolean;
6
- }
7
- /**
8
- * A single-line input that renders {{variable}} patterns as styled chips.
9
- * Uses a minimal TipTap editor under the hood for rich content rendering.
10
- */
11
- export declare const VariableInput: React.ForwardRefExoticComponent<VariableInputProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,9 +0,0 @@
1
- import * as React from "react";
2
- import { type VariableEditorBaseProps } from "./shared";
3
- export interface VariableTextareaProps extends VariableEditorBaseProps {
4
- }
5
- /**
6
- * A textarea-like input that renders {{variable}} patterns as styled chips.
7
- * Uses a minimal TipTap editor under the hood for rich content rendering.
8
- */
9
- export declare const VariableTextarea: React.ForwardRefExoticComponent<VariableTextareaProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,6 +0,0 @@
1
- export { VariableTextarea } from "./VariableTextarea";
2
- export type { VariableTextareaProps } from "./VariableTextarea";
3
- export { VariableInput } from "./VariableInput";
4
- export type { VariableInputProps } from "./VariableInput";
5
- export { parseStringToContent, contentToString, SimpleVariableNode, SimpleVariableView, VariableChipIcon, } from "./shared";
6
- export type { VariableEditorBaseProps } from "./shared";
@@ -1,51 +0,0 @@
1
- import { Node } from "@tiptap/core";
2
- import type { Content, JSONContent } from "@tiptap/core";
3
- import type { NodeViewProps } from "@tiptap/react";
4
- import * as React from "react";
5
- /**
6
- * Simple variable icon for the chip
7
- */
8
- export declare const VariableChipIcon: React.FC<{
9
- color?: string;
10
- }>;
11
- /**
12
- * Standalone variable view component
13
- * Does not depend on external jotai stores
14
- */
15
- export declare const SimpleVariableView: React.FC<NodeViewProps>;
16
- /**
17
- * Custom VariableNode that uses SimpleVariableView
18
- * Used in VariableInput and VariableTextarea components
19
- */
20
- export declare const SimpleVariableNode: Node<any, any>;
21
- /**
22
- * Parses a string with {{variable}} syntax into TipTap JSON content
23
- */
24
- export declare function parseStringToContent(text: string): Content;
25
- /**
26
- * Converts TipTap JSON content back to string with {{variable}} syntax
27
- */
28
- export declare function contentToString(doc: JSONContent): string;
29
- /**
30
- * Base props shared between VariableInput and VariableTextarea
31
- */
32
- export interface VariableEditorBaseProps {
33
- /** The current value with {{variable}} syntax */
34
- value?: string;
35
- /** Called when the value changes */
36
- onChange?: (value: string) => void;
37
- /** List of available variable names for autocomplete */
38
- variables?: string[];
39
- /** Placeholder text */
40
- placeholder?: string;
41
- /** Additional CSS classes */
42
- className?: string;
43
- /** Whether the input is disabled */
44
- disabled?: boolean;
45
- /** Whether to disable variable autocomplete suggestions */
46
- disableVariableAutocomplete?: boolean;
47
- /** Called when the input gains focus */
48
- onFocus?: () => void;
49
- /** Called when the input loses focus */
50
- onBlur?: () => void;
51
- }