@bikdotai/bik-component-library 0.0.811-beta.2 → 0.0.811
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.
- package/dist/cjs/components/feature-announcements/hooks/useFeatureAnnouncements.js +1 -1
- package/dist/cjs/components/feature-announcements/hooks/useFeatureAnnouncements.js.map +1 -1
- package/dist/cjs/editor/BikEditor.js +1 -1
- package/dist/cjs/editor/BikEditor.js.map +1 -1
- package/dist/cjs/editor/BikEditor.styles.js +12 -22
- package/dist/cjs/editor/BikEditor.styles.js.map +1 -1
- package/dist/cjs/editor/BikEditor.types.js.map +1 -1
- package/dist/cjs/editor/BikEditor.utils.js +1 -1
- package/dist/cjs/editor/BikEditor.utils.js.map +1 -1
- package/dist/cjs/editor/extensions/buildExtensions.js +1 -1
- package/dist/cjs/editor/extensions/buildExtensions.js.map +1 -1
- package/dist/cjs/editor/extensions/plainClipboard/PasteNormalizationExtension.js +1 -1
- package/dist/cjs/editor/extensions/plainClipboard/PasteNormalizationExtension.js.map +1 -1
- package/dist/cjs/editor/extensions/plainClipboard/pasteUtils.js +1 -1
- package/dist/cjs/editor/extensions/plainClipboard/pasteUtils.js.map +1 -1
- package/dist/cjs/src/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/cjs/src/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/src/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/cjs/src/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/cjs/src/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/cjs/src/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/cjs/src/editor/BikEditor.styles.d.ts +1 -1
- package/dist/cjs/src/editor/BikEditor.types.d.ts +2 -0
- package/dist/cjs/src/editor/BikEditor.utils.d.ts +8 -14
- package/dist/cjs/src/editor/extensions/buildExtensions.d.ts +2 -1
- package/dist/cjs/src/editor/extensions/plainClipboard/PasteNormalizationExtension.d.ts +4 -22
- package/dist/cjs/src/editor/extensions/plainClipboard/pasteUtils.d.ts +5 -28
- package/dist/esm/components/feature-announcements/hooks/useFeatureAnnouncements.js +1 -1
- package/dist/esm/components/feature-announcements/hooks/useFeatureAnnouncements.js.map +1 -1
- package/dist/esm/editor/BikEditor.js +1 -1
- package/dist/esm/editor/BikEditor.js.map +1 -1
- package/dist/esm/editor/BikEditor.styles.js +12 -22
- package/dist/esm/editor/BikEditor.styles.js.map +1 -1
- package/dist/esm/editor/BikEditor.types.js.map +1 -1
- package/dist/esm/editor/BikEditor.utils.js +1 -1
- package/dist/esm/editor/BikEditor.utils.js.map +1 -1
- package/dist/esm/editor/extensions/buildExtensions.js +1 -1
- package/dist/esm/editor/extensions/buildExtensions.js.map +1 -1
- package/dist/esm/editor/extensions/plainClipboard/PasteNormalizationExtension.js +1 -1
- package/dist/esm/editor/extensions/plainClipboard/PasteNormalizationExtension.js.map +1 -1
- package/dist/esm/editor/extensions/plainClipboard/pasteUtils.js +1 -1
- package/dist/esm/editor/extensions/plainClipboard/pasteUtils.js.map +1 -1
- package/dist/esm/src/components/QueryBuilder/Triggers/EVENTS/components/EventsTrigger.d.ts +1 -1
- package/dist/esm/src/components/QueryBuilder/Triggers/EVENTS/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/src/components/QueryBuilder/Triggers/IG/components/IGTrigger.d.ts +1 -1
- package/dist/esm/src/components/QueryBuilder/Triggers/IG/selectors/useIGTriggerNameCacheSelector.d.ts +1 -1
- package/dist/esm/src/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts +2 -2
- package/dist/esm/src/components/bik-layout/MockMenus.d.ts +0 -1
- package/dist/esm/src/editor/BikEditor.styles.d.ts +1 -1
- package/dist/esm/src/editor/BikEditor.types.d.ts +2 -0
- package/dist/esm/src/editor/BikEditor.utils.d.ts +8 -14
- package/dist/esm/src/editor/extensions/buildExtensions.d.ts +2 -1
- package/dist/esm/src/editor/extensions/plainClipboard/PasteNormalizationExtension.d.ts +4 -22
- package/dist/esm/src/editor/extensions/plainClipboard/pasteUtils.d.ts +5 -28
- package/package.json +1 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryBuilderNodeProps } from "../../../
|
|
2
|
+
import { QueryBuilderNodeProps } from "../../../types/QueryBuilderNodeProps.type";
|
|
3
3
|
declare const IGTrigger: React.FC<QueryBuilderNodeProps>;
|
|
4
4
|
export default IGTrigger;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QueryBuilderAPIData } from "../../../
|
|
1
|
+
import { QueryBuilderAPIData } from "../../../types/QueryBuilderAPI.type";
|
|
2
2
|
export declare const useIGTriggerNameCacheSelector: () => QueryBuilderAPIData[];
|
package/dist/esm/src/components/QueryBuilder/Triggers/components/BaseTriggerQueryBuilderNode.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropdownOption } from "../../../dropdown/type";
|
|
3
|
-
import { QueryBuilderProperty } from "../../
|
|
4
|
-
import { QueryBuilderNodeProps } from "../../
|
|
3
|
+
import { QueryBuilderProperty } from "../../types/QueryBuilder.type";
|
|
4
|
+
import { QueryBuilderNodeProps } from "../../types/QueryBuilderNodeProps.type";
|
|
5
5
|
declare const BaseTriggerQueryBuilderNode: React.FC<QueryBuilderNodeProps & {
|
|
6
6
|
cacheKey: string;
|
|
7
7
|
propertyAddBtnText: string;
|
|
@@ -728,4 +728,6 @@ export interface BikEditorProps {
|
|
|
728
728
|
minHeight?: string;
|
|
729
729
|
/** Maximum height. The editor scrolls internally when exceeded. CSS value, e.g. `'400px'`. */
|
|
730
730
|
maxHeight?: string;
|
|
731
|
+
/** Gap between consecutive paragraphs. CSS value, defaults to `'4px'`. */
|
|
732
|
+
paragraphGap?: string;
|
|
731
733
|
}
|
|
@@ -3,20 +3,14 @@ import { EditorSnapshot, FormatState } from './BikEditor.types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Normalise HTML before passing it to TipTap.
|
|
5
5
|
*
|
|
6
|
-
* 1.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* create a `hard_break` child AND the cursor `<br>` → double-height blank line.
|
|
15
|
-
*
|
|
16
|
-
* Uses the DOM (regex cannot selectively pair span tags). `normalizeHtml` runs
|
|
17
|
-
* in the component body for `initialContent`, so it is guarded for SSR: the
|
|
18
|
-
* editor is created lazily on the client (`immediatelyRender: false`), meaning
|
|
19
|
-
* the value is only parsed client-side and passing through on the server is safe.
|
|
6
|
+
* 1. Strip all `<span>` tags first (keeps inner content). This exposes
|
|
7
|
+
* bare `<br>` inside otherwise-empty paragraphs like Quill's
|
|
8
|
+
* `<p><span class="ql-cursor"><br></span></p>`.
|
|
9
|
+
* 2. Then convert `<p><br></p>` → `<p></p>`. ProseMirror parses `<p></p>`
|
|
10
|
+
* as an empty paragraph node and adds its own DOM `<br>` for cursor
|
|
11
|
+
* positioning — one blank line, correct height. Leaving the `<br>`
|
|
12
|
+
* would create a `hard_break` child AND the cursor `<br>`, producing
|
|
13
|
+
* double-height blank lines.
|
|
20
14
|
*/
|
|
21
15
|
export declare function normalizeHtml(html: string): string;
|
|
22
16
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
1
2
|
import type { ReactNode } from 'react';
|
|
2
3
|
import type { EditorFeatures, EditorSnapshot, KeyboardShortcut, MentionDropdownRenderProps, MentionItem, PasteData, SlashCommandDropdownRenderProps, SlashCommandItem } from '../BikEditor.types';
|
|
3
4
|
interface ExtensionConfig {
|
|
@@ -33,5 +34,5 @@ interface ExtensionConfig {
|
|
|
33
34
|
renderSlashCommandItem?: (item: SlashCommandItem, isActive: boolean) => ReactNode;
|
|
34
35
|
renderSlashCommandDropdown?: (props: SlashCommandDropdownRenderProps) => ReactNode;
|
|
35
36
|
}
|
|
36
|
-
export declare function buildExtensions(config: ExtensionConfig): (import("@tiptap/core").Node<import("@tiptap/extension-
|
|
37
|
+
export declare function buildExtensions(config: ExtensionConfig): (import("@tiptap/core").Node<import("@tiptap/extension-paragraph").ParagraphOptions, any> | Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | Extension<any, any> | import("@tiptap/core").Mark<import("@tiptap/extension-underline").UnderlineOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-link").LinkOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-text-style").TextStyleOptions, any> | Extension<import("@tiptap/extensions").PlaceholderOptions, any> | Extension<import("@tiptap/extensions").CharacterCountOptions, import("@tiptap/extensions").CharacterCountStorage> | import("@tiptap/core").Node<any, any> | import("@tiptap/core").Node<import("@tiptap/extension-mention").MentionOptions<any, import("@tiptap/extension-mention").MentionNodeAttrs>, any> | Extension<import("@tiptap/extension-text-style").ColorOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-highlight").HighlightOptions, any> | Extension<import("@tiptap/extension-text-align").TextAlignOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-image").ImageOptions, any>)[];
|
|
37
38
|
export {};
|
|
@@ -3,29 +3,11 @@ import { Extension } from '@tiptap/core';
|
|
|
3
3
|
* Unified paste normalizer for all editor channels.
|
|
4
4
|
*
|
|
5
5
|
* Uses ProseMirror's recommended hooks instead of overriding handlePaste:
|
|
6
|
-
* - clipboardTextParser: plain text → Slice (
|
|
6
|
+
* - clipboardTextParser: plain text → Slice (preserves blank lines)
|
|
7
7
|
* - transformPastedHTML: HTML → HTML (cleans Google Docs / Word artifacts)
|
|
8
|
-
* - transformPasted: Slice → Slice (
|
|
9
|
-
* mirror the source paragraph-margin convention)
|
|
8
|
+
* - transformPasted: Slice → Slice (normalizes hardBreaks, strips marks)
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* plain/paste-without-formatting content stays margin:0 (tight).
|
|
14
|
-
*
|
|
15
|
-
* `appendTransaction` does two bounded touch-ups:
|
|
16
|
-
* 1. Repairs the FIRST pasted paragraph — ProseMirror merges it into the
|
|
17
|
-
* cursor's paragraph at paste time, dropping its margin attr; we record that
|
|
18
|
-
* margin (in transformPasted / the plain handlePaste) and reapply it at the
|
|
19
|
-
* paste position.
|
|
20
|
-
* 2. Typed-Enter inheritance — splitBlock gives a paragraph created at a block
|
|
21
|
-
* end DEFAULT attrs, so an empty paragraph that follows a margin:0 paragraph
|
|
22
|
-
* is set to margin:0 too. Typing inside tight content stays tight; default
|
|
23
|
-
* content stays default; non-empty (pasted) paragraphs are never touched.
|
|
24
|
-
*
|
|
25
|
-
* `plainOnly` (channels with no rich formatting — WhatsApp, IG, FB, comments)
|
|
26
|
-
* forces EVERY paste through the plain-text path: even Cmd/Ctrl+V ignores the
|
|
27
|
-
* clipboard HTML and pastes text only, since those channels don't support
|
|
28
|
-
* formatting anyway. Email and the signature editor (richPaste) keep the full
|
|
29
|
-
* HTML pipeline.
|
|
10
|
+
* Also decorates empty paragraphs with an `is-blank` CSS class so the
|
|
11
|
+
* editor stylesheet can give blank lines precise height without extra margins.
|
|
30
12
|
*/
|
|
31
13
|
export declare const PasteNormalizationExtension: Extension<any, any>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Fragment, Schema, Slice } from '@tiptap/pm/model';
|
|
2
2
|
export declare const TEXTBLOCK_TAGS: Set<string>;
|
|
3
3
|
export declare const BLOCK_SELECTOR = "p,div,h1,h2,h3,h4,h5,h6,ul,ol,li,blockquote,table,pre";
|
|
4
|
-
/** Normalise clipboard newlines: Windows CRLF and lone CR → LF. */
|
|
5
|
-
export declare function normalizeNewlines(text: string): string;
|
|
6
4
|
/**
|
|
7
5
|
* When pasted HTML is entirely inline (no block elements), split at
|
|
8
6
|
* `<br><br>` boundaries into `<p>` elements. Single `<br>` stays as a
|
|
@@ -23,31 +21,14 @@ export declare function cleanBlockBrs(container: HTMLElement): void;
|
|
|
23
21
|
*/
|
|
24
22
|
export declare function stripTrailingBrs(container: HTMLElement): void;
|
|
25
23
|
/**
|
|
26
|
-
* Convert
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* (childCount 0) gives a single-height blank line.
|
|
24
|
+
* Convert paragraphs containing only a hardBreak into truly empty paragraphs.
|
|
25
|
+
* Google Docs represents blank lines as `<p><br></p>` — ProseMirror parses
|
|
26
|
+
* the `<br>` as a hardBreak node, which renders double-height. Converting to
|
|
27
|
+
* an empty paragraph (childCount 0) gives a single-height blank line.
|
|
30
28
|
*
|
|
31
|
-
* Does NOT
|
|
32
|
-
* collapse consecutive empties — those `<br>`s/blank lines are intentional
|
|
33
|
-
* (e.g. shift+enter / enter runs from Google Docs) and Gmail preserves them.
|
|
29
|
+
* Does NOT collapse consecutive empties — that would destroy user intent.
|
|
34
30
|
*/
|
|
35
31
|
export declare function normalizeHardBreaks(fragment: Fragment): Fragment;
|
|
36
|
-
/**
|
|
37
|
-
* Mirror the source paragraph-margin convention across a pasted block.
|
|
38
|
-
*
|
|
39
|
-
* Gmail decides spacing from the SOURCE: it keeps default margins for content
|
|
40
|
-
* pasted from ChatGPT/plain `<p>`, and `margin:0` for Google-Docs-style content
|
|
41
|
-
* (whose paragraphs carry `margin:0`). We do the same. A paragraph's margin is
|
|
42
|
-
* already preserved from the source (the Paragraph node's `margin` attribute),
|
|
43
|
-
* so the only gap is the synthesized blank-line paragraphs (created from a
|
|
44
|
-
* Google-Docs block-level `<br>`), which have no source margin. If the pasted
|
|
45
|
-
* block is margin:0-style (any paragraph carries margin:0), apply margin:0 to
|
|
46
|
-
* every paragraph of THIS paste — so the blank lines match. Pastes with no
|
|
47
|
-
* margin:0 paragraph (ChatGPT, plain text) are left untouched → default margins.
|
|
48
|
-
* Scoped to the pasted slice, so it never tightens existing/typed content.
|
|
49
|
-
*/
|
|
50
|
-
export declare function mirrorParagraphMargins(fragment: Fragment): Fragment;
|
|
51
32
|
/**
|
|
52
33
|
* Strip "rich" marks (link, textStyle, highlight, etc.) while keeping
|
|
53
34
|
* basic marks (bold, italic, strike, underline, code) that messaging
|
|
@@ -68,9 +49,5 @@ export declare function parseClipboardText(text: string, schema: Schema): Slice;
|
|
|
68
49
|
* every `\n`. Produces the same structure as Gmail's Cmd+Shift+V output:
|
|
69
50
|
* one block element with `<br>` for line breaks and `<br><br>` for blank
|
|
70
51
|
* lines. This gives identical html and text output to Gmail.
|
|
71
|
-
*
|
|
72
|
-
* The paragraph is tight (`margin: '0'`) — plain/paste-without-formatting is
|
|
73
|
-
* Gmail's `<div>` (no margin), and typed Enter inherits this margin, so
|
|
74
|
-
* splitting plain-pasted text stays tight like Gmail (not default-margin gaps).
|
|
75
52
|
*/
|
|
76
53
|
export declare function parseClipboardTextAsBreaks(text: string, schema: Schema): Slice;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bikdotai/bik-component-library",
|
|
3
|
-
"version": "0.0.811
|
|
3
|
+
"version": "0.0.811",
|
|
4
4
|
"description": "Bik Component Library",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -71,7 +71,6 @@
|
|
|
71
71
|
"@tiptap/extension-character-count": "^3.22.5",
|
|
72
72
|
"@tiptap/extension-color": "^3.22.5",
|
|
73
73
|
"@tiptap/extension-font-family": "^3.22.5",
|
|
74
|
-
"@tiptap/extension-hard-break": "^3.22.5",
|
|
75
74
|
"@tiptap/extension-highlight": "^3.22.5",
|
|
76
75
|
"@tiptap/extension-image": "^3.22.5",
|
|
77
76
|
"@tiptap/extension-link": "^3.22.5",
|