@blazetrails/actiontext 0.0.0-stage → 0.1.0-alpha0.2
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/LICENSE +21 -0
- package/app/views/action-text/attachables/_content_attachment.html.tse +3 -0
- package/app/views/action-text/attachables/_missing_attachable.html.tse +1 -0
- package/app/views/action-text/attachables/_remote_image.html.tse +8 -0
- package/app/views/action-text/attachment-galleries/_attachment_gallery.html.tse +3 -0
- package/app/views/action-text/contents/_content.html.tse +1 -0
- package/app/views/active-storage/blobs/_blob.html.tse +14 -0
- package/app/views/layouts/action-text/contents/_content.html.tse +3 -0
- package/dist/.trails/views/action-text/attachables/_content_attachment.html.tse.js +35 -0
- package/dist/.trails/views/action-text/attachables/_content_attachment.html.tse.js.map +1 -0
- package/dist/.trails/views/action-text/attachables/_missing_attachable.html.tse.js +16 -0
- package/dist/.trails/views/action-text/attachables/_missing_attachable.html.tse.js.map +1 -0
- package/dist/.trails/views/action-text/attachables/_remote_image.html.tse.js +42 -0
- package/dist/.trails/views/action-text/attachables/_remote_image.html.tse.js.map +1 -0
- package/dist/.trails/views/action-text/attachment-galleries/_attachment_gallery.html.tse.js +37 -0
- package/dist/.trails/views/action-text/attachment-galleries/_attachment_gallery.html.tse.js.map +1 -0
- package/dist/.trails/views/action-text/contents/_content.html.tse.js +34 -0
- package/dist/.trails/views/action-text/contents/_content.html.tse.js.map +1 -0
- package/dist/.trails/views/active-storage/blobs/_blob.html.tse.js +57 -0
- package/dist/.trails/views/active-storage/blobs/_blob.html.tse.js.map +1 -0
- package/dist/.trails/views/layouts/action-text/contents/_content.html.tse.js +18 -0
- package/dist/.trails/views/layouts/action-text/contents/_content.html.tse.js.map +1 -0
- package/dist/action-text.js +73 -0
- package/dist/action-text.js.map +1 -0
- package/dist/app/helpers/action-text/content-helper.js +84 -0
- package/dist/app/helpers/action-text/content-helper.js.map +1 -0
- package/dist/app/helpers/action-text/tag-helper.js +115 -0
- package/dist/app/helpers/action-text/tag-helper.js.map +1 -0
- package/dist/app/views/action-text/attachables/_content_attachment.html.tse +3 -0
- package/dist/app/views/action-text/attachables/_missing_attachable.html.tse +1 -0
- package/dist/app/views/action-text/attachables/_remote_image.html.tse +8 -0
- package/dist/app/views/action-text/attachment-galleries/_attachment_gallery.html.tse +3 -0
- package/dist/app/views/action-text/contents/_content.html.tse +1 -0
- package/dist/app/views/active-storage/blobs/_blob.html.tse +14 -0
- package/dist/app/views/layouts/action-text/contents/_content.html.tse +3 -0
- package/dist/attachable.js +118 -0
- package/dist/attachable.js.map +1 -0
- package/dist/attachables/content-attachment.js +55 -0
- package/dist/attachables/content-attachment.js.map +1 -0
- package/dist/attachables/missing-attachable.js +30 -0
- package/dist/attachables/missing-attachable.js.map +1 -0
- package/dist/attachables/remote-image.js +46 -0
- package/dist/attachables/remote-image.js.map +1 -0
- package/dist/attachment-gallery.js +64 -0
- package/dist/attachment-gallery.js.map +1 -0
- package/dist/attachment.js +122 -0
- package/dist/attachment.js.map +1 -0
- package/dist/attachments/caching.js +17 -0
- package/dist/attachments/caching.js.map +1 -0
- package/dist/attachments/minification.js +15 -0
- package/dist/attachments/minification.js.map +1 -0
- package/dist/attachments/trix-conversion.js +37 -0
- package/dist/attachments/trix-conversion.js.map +1 -0
- package/dist/attribute.js +83 -0
- package/dist/attribute.js.map +1 -0
- package/dist/constants.action-text-install-install-generator.generated.js +4 -0
- package/dist/constants.action-text-install-install-generator.generated.js.map +1 -0
- package/dist/constants.encrypted-rich-text.generated.js +4 -0
- package/dist/constants.encrypted-rich-text.generated.js.map +1 -0
- package/dist/constants.engine.generated.js +4 -0
- package/dist/constants.engine.generated.js.map +1 -0
- package/dist/constants.generated.js +53 -0
- package/dist/constants.generated.js.map +1 -0
- package/dist/constants.rich-text.generated.js +4 -0
- package/dist/constants.rich-text.generated.js.map +1 -0
- package/dist/content.js +162 -0
- package/dist/content.js.map +1 -0
- package/dist/db/migrate/20180528164100_create_action_text_tables.js +31 -0
- package/dist/db/migrate/20180528164100_create_action_text_tables.js.map +1 -0
- package/dist/deprecator.js +8 -0
- package/dist/deprecator.js.map +1 -0
- package/dist/encrypted-rich-text.js +12 -0
- package/dist/encrypted-rich-text.js.map +1 -0
- package/dist/encryption.js +56 -0
- package/dist/encryption.js.map +1 -0
- package/dist/engine.js +125 -0
- package/dist/engine.js.map +1 -0
- package/dist/fixture-set.js +14 -0
- package/dist/fixture-set.js.map +1 -0
- package/dist/fragment.js +59 -0
- package/dist/fragment.js.map +1 -0
- package/dist/gem-version.js +18 -0
- package/dist/gem-version.js.map +1 -0
- package/dist/generators/action-text/install/install-generator.js +88 -0
- package/dist/generators/action-text/install/install-generator.js.map +1 -0
- package/dist/generators/action-text/install/templates/actiontext.css.tt +440 -0
- package/dist/generators/action-text/install/templates/actiontext.css.tt.js +12 -0
- package/dist/html-conversion.js +21 -0
- package/dist/html-conversion.js.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/plain-text-conversion.js +126 -0
- package/dist/plain-text-conversion.js.map +1 -0
- package/dist/record.js +11 -0
- package/dist/record.js.map +1 -0
- package/dist/rendering.js +35 -0
- package/dist/rendering.js.map +1 -0
- package/dist/rich-text.js +70 -0
- package/dist/rich-text.js.map +1 -0
- package/dist/serialization.js +30 -0
- package/dist/serialization.js.map +1 -0
- package/dist/system-test-helper.js +38 -0
- package/dist/system-test-helper.js.map +1 -0
- package/dist/tasks/actiontext.rake.js +8 -0
- package/dist/tasks/actiontext.rake.js.map +1 -0
- package/dist/trails/generators/test-unit/install/install-generator.js +16 -0
- package/dist/trails/generators/test-unit/install/install-generator.js.map +1 -0
- package/dist/trails/generators/test-unit/install/templates/fixtures.yml.tt +4 -0
- package/dist/trails/generators/test-unit/install/templates/fixtures.yml.tt.js +12 -0
- package/dist/trix-attachment.js +105 -0
- package/dist/trix-attachment.js.map +1 -0
- package/dist/types/action-text.d.ts +75 -0
- package/dist/types/app/helpers/action-text/content-helper.d.ts +35 -0
- package/dist/types/app/helpers/action-text/tag-helper.d.ts +48 -0
- package/dist/types/attachable.d.ts +41 -0
- package/dist/types/attachables/content-attachment.d.ts +30 -0
- package/dist/types/attachables/missing-attachable.d.ts +9 -0
- package/dist/types/attachables/remote-image.d.ts +23 -0
- package/dist/types/attachment-gallery.d.ts +23 -0
- package/dist/types/attachment.d.ts +51 -0
- package/dist/types/attachments/caching.d.ts +15 -0
- package/dist/types/attachments/minification.d.ts +5 -0
- package/dist/types/attachments/trix-conversion.d.ts +17 -0
- package/dist/types/attribute.d.ts +27 -0
- package/dist/types/constants.action-text-install-install-generator.generated.d.ts +2 -0
- package/dist/types/constants.encrypted-rich-text.generated.d.ts +2 -0
- package/dist/types/constants.engine.generated.d.ts +2 -0
- package/dist/types/constants.generated.d.ts +2 -0
- package/dist/types/constants.rich-text.generated.d.ts +2 -0
- package/dist/types/content.d.ts +73 -0
- package/dist/types/db/migrate/20180528164100_create_action_text_tables.d.ts +9 -0
- package/dist/types/deprecator.d.ts +3 -0
- package/dist/types/encrypted-rich-text.d.ts +5 -0
- package/dist/types/encryption.d.ts +30 -0
- package/dist/types/engine.d.ts +28 -0
- package/dist/types/fixture-set.d.ts +6 -0
- package/dist/types/fragment.d.ts +19 -0
- package/dist/types/gem-version.d.ts +10 -0
- package/dist/types/generators/action-text/install/install-generator.d.ts +25 -0
- package/dist/types/html-conversion.d.ts +9 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/plain-text-conversion.d.ts +41 -0
- package/dist/types/record.d.ts +4 -0
- package/dist/types/rendering.d.ts +15 -0
- package/dist/types/rich-text.d.ts +24 -0
- package/dist/types/serialization.d.ts +25 -0
- package/dist/types/system-test-helper.d.ts +18 -0
- package/dist/types/tasks/actiontext.rake.d.ts +2 -0
- package/dist/types/trails/generators/test-unit/install/install-generator.d.ts +5 -0
- package/dist/types/trix-attachment.d.ts +33 -0
- package/dist/types/version.d.ts +3 -0
- package/dist/version.js +7 -0
- package/dist/version.js.map +1 -0
- package/package.json +71 -3
- package/README.md +0 -3
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type SafeBuffer } from "@blazetrails/activesupport";
|
|
2
|
+
import { Base } from "@blazetrails/actionview/helpers/tags/base.js";
|
|
3
|
+
import { classModule } from "@blazetrails/ruby-compat";
|
|
4
|
+
type Options = Record<string, unknown>;
|
|
5
|
+
type MainApp = {
|
|
6
|
+
trailsDirectUploadsUrl(): unknown;
|
|
7
|
+
trailsServiceBlobUrl(signedId: string, filename: string): unknown;
|
|
8
|
+
};
|
|
9
|
+
type TagHelperHost = {
|
|
10
|
+
mainApp: MainApp;
|
|
11
|
+
contentTag(name: string, content: unknown, options: Options): SafeBuffer;
|
|
12
|
+
hiddenFieldTag(name: unknown, value: unknown, options: Options): SafeBuffer;
|
|
13
|
+
};
|
|
14
|
+
export declare class TagHelper {
|
|
15
|
+
/** @noRailsEquivalent PERMANENT */
|
|
16
|
+
static readonly [classModule] = true;
|
|
17
|
+
static id: number;
|
|
18
|
+
/** @missingRailsArgs rails_service_blob_url — PERMANENT */
|
|
19
|
+
richTextareaTag(this: TagHelperHost, name: unknown, value?: unknown, options?: Options): Promise<SafeBuffer>;
|
|
20
|
+
richTextAreaTag: TagHelper["richTextareaTag"];
|
|
21
|
+
}
|
|
22
|
+
export declare class ActionText extends Base {
|
|
23
|
+
domId: (recordOrClass: unknown, prefix?: string | null) => string;
|
|
24
|
+
/** @inlinedFrom ActionView::Helpers::Tags::Placeholderable#initialize rails/v8.0.5.2/actionview/lib/action_view/helpers/tags/placeholderable.rb:7-20 */
|
|
25
|
+
constructor(objectName: unknown, methodName: unknown, templateObject: unknown, options?: Options);
|
|
26
|
+
render(): Promise<unknown>;
|
|
27
|
+
}
|
|
28
|
+
type FormBuilderHost = {
|
|
29
|
+
_template: {
|
|
30
|
+
richTextarea(objectName: unknown, method: unknown, options: Options): Promise<unknown>;
|
|
31
|
+
};
|
|
32
|
+
objectName: unknown;
|
|
33
|
+
objectifyOptions(options: Options): Options;
|
|
34
|
+
};
|
|
35
|
+
export declare class FormHelper {
|
|
36
|
+
/** @noRailsEquivalent PERMANENT */
|
|
37
|
+
static readonly [classModule] = true;
|
|
38
|
+
richTextarea(objectName: unknown, method: unknown, options?: Options): Promise<unknown>;
|
|
39
|
+
richTextArea: FormHelper["richTextarea"];
|
|
40
|
+
}
|
|
41
|
+
export declare class FormBuilder {
|
|
42
|
+
/** @noRailsEquivalent PERMANENT */
|
|
43
|
+
static readonly [classModule] = true;
|
|
44
|
+
richTextarea(this: FormBuilderHost, method: unknown, options?: Options): Promise<unknown>;
|
|
45
|
+
richTextArea: FormBuilder["richTextarea"];
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=tag-helper.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Concern, type Extended } from "@blazetrails/activesupport";
|
|
2
|
+
import type { Html5Node } from "@blazetrails/nokogiri";
|
|
3
|
+
interface AttachableHost {
|
|
4
|
+
toSgid(options: Record<string, unknown>): {
|
|
5
|
+
toString(): string;
|
|
6
|
+
};
|
|
7
|
+
toPartialPath(): string;
|
|
8
|
+
isPersisted(): boolean;
|
|
9
|
+
attachableSgid(): string;
|
|
10
|
+
attachableContentType(): unknown;
|
|
11
|
+
attachableFilename(): string | null | undefined;
|
|
12
|
+
attachableFilesize(): unknown;
|
|
13
|
+
attachableMetadata(): Record<string, unknown>;
|
|
14
|
+
isPreviewableAttachable(): boolean;
|
|
15
|
+
}
|
|
16
|
+
declare function attributeNamesForSerialization(this: AttachableHost): string[];
|
|
17
|
+
/** @missingRailsCall super — PERMANENT */
|
|
18
|
+
declare function readAttributeForSerialization(this: AttachableHost, key: string): unknown;
|
|
19
|
+
export declare const Attachable: Extended<typeof Concern> & {
|
|
20
|
+
ClassMethods: Record<string, unknown>;
|
|
21
|
+
attachableSgid(this: AttachableHost): string;
|
|
22
|
+
attachableContentType(this: AttachableHost): unknown;
|
|
23
|
+
attachableFilename(this: AttachableHost): string | null;
|
|
24
|
+
attachableFilesize(this: AttachableHost): unknown;
|
|
25
|
+
attachableMetadata(this: AttachableHost): Record<string, unknown>;
|
|
26
|
+
isPreviewableAttachable(this: AttachableHost): boolean;
|
|
27
|
+
toTrixContentAttachmentPartialPath(this: AttachableHost): unknown;
|
|
28
|
+
toAttachablePartialPath(this: AttachableHost): unknown;
|
|
29
|
+
toRichTextAttributes(this: AttachableHost, attributes?: Record<string, unknown>): Record<string, unknown>;
|
|
30
|
+
/** @internal */
|
|
31
|
+
attributeNamesForSerialization: typeof attributeNamesForSerialization;
|
|
32
|
+
/** @internal */
|
|
33
|
+
readAttributeForSerialization: typeof readAttributeForSerialization;
|
|
34
|
+
LOCATOR_NAME: string;
|
|
35
|
+
fromNode(node: Html5Node): Promise<unknown>;
|
|
36
|
+
fromAttachableSgid(sgid: unknown, options?: Record<string, unknown>): Promise<unknown>;
|
|
37
|
+
/** @internal */
|
|
38
|
+
attachableFromSgid(sgid: unknown): Promise<unknown>;
|
|
39
|
+
};
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=attachable.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Model } from "@blazetrails/activemodel";
|
|
2
|
+
import type { Html5Node } from "@blazetrails/nokogiri";
|
|
3
|
+
export interface ContentAttachment extends Model {
|
|
4
|
+
}
|
|
5
|
+
export declare class ContentAttachment {
|
|
6
|
+
static validatesFormatOf: typeof Model.validatesFormatOf;
|
|
7
|
+
static validatesPresenceOf: typeof Model.validatesPresenceOf;
|
|
8
|
+
/** @inlinedFrom ActiveModel::API#initialize rails/v8.0.5.2/activemodel/lib/active_model/api.rb:80-84 */
|
|
9
|
+
constructor(attributes?: Record<string, unknown> | null);
|
|
10
|
+
static fromNode(node: Html5Node): Promise<ContentAttachment | null>;
|
|
11
|
+
/** @internal */
|
|
12
|
+
private _contentType;
|
|
13
|
+
/** @internal */
|
|
14
|
+
private _content;
|
|
15
|
+
/** @internal */
|
|
16
|
+
private _toHtml?;
|
|
17
|
+
/** @internal */
|
|
18
|
+
private _contentInstance?;
|
|
19
|
+
get contentType(): unknown;
|
|
20
|
+
set contentType(value: unknown);
|
|
21
|
+
get content(): unknown;
|
|
22
|
+
set content(value: unknown);
|
|
23
|
+
attachablePlainTextRepresentation(_caption: string | null): Promise<unknown>;
|
|
24
|
+
toHtml(): Promise<unknown>;
|
|
25
|
+
toString(): Promise<unknown>;
|
|
26
|
+
toPartialPath(): string;
|
|
27
|
+
/** @internal */
|
|
28
|
+
private contentInstance;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=content-attachment.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class MissingAttachable {
|
|
2
|
+
static readonly DEFAULT_PARTIAL_PATH = "action_text/attachables/missing_attachable";
|
|
3
|
+
/** @internal */
|
|
4
|
+
private readonly sgid;
|
|
5
|
+
constructor(sgid: unknown);
|
|
6
|
+
toPartialPath(): string;
|
|
7
|
+
model(): unknown;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=missing-attachable.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Html5Node } from "@blazetrails/nokogiri";
|
|
2
|
+
interface RemoteImageAttributes {
|
|
3
|
+
url?: string | null;
|
|
4
|
+
contentType?: string | null;
|
|
5
|
+
width?: string | null;
|
|
6
|
+
height?: string | null;
|
|
7
|
+
}
|
|
8
|
+
export declare class RemoteImage {
|
|
9
|
+
static fromNode(node: Html5Node): RemoteImage | null;
|
|
10
|
+
/** @internal */
|
|
11
|
+
private static isContentTypeIsImage;
|
|
12
|
+
/** @internal */
|
|
13
|
+
private static attributesFromNode;
|
|
14
|
+
readonly url: string | null | undefined;
|
|
15
|
+
readonly contentType: string | null | undefined;
|
|
16
|
+
readonly width: string | null | undefined;
|
|
17
|
+
readonly height: string | null | undefined;
|
|
18
|
+
constructor(attributes?: RemoteImageAttributes);
|
|
19
|
+
attachablePlainTextRepresentation(caption: string | null): string;
|
|
20
|
+
toPartialPath(): string;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=remote-image.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Model } from "@blazetrails/activemodel";
|
|
2
|
+
import type { Html5Node } from "@blazetrails/nokogiri";
|
|
3
|
+
import type { Attachment } from "./attachment.js";
|
|
4
|
+
import { Fragment } from "./fragment.js";
|
|
5
|
+
export interface AttachmentGallery extends Model {
|
|
6
|
+
}
|
|
7
|
+
export declare class AttachmentGallery {
|
|
8
|
+
static modelName: typeof Model.modelName;
|
|
9
|
+
static fragmentByCanonicalizingAttachmentGalleries(content: unknown): Promise<Fragment>;
|
|
10
|
+
static fragmentByReplacingAttachmentGalleryNodes(content: unknown, block: (node: Html5Node) => unknown): Promise<Fragment>;
|
|
11
|
+
static findAttachmentGalleryNodes(content: unknown): Html5Node[];
|
|
12
|
+
static fromNode(node: Html5Node): AttachmentGallery;
|
|
13
|
+
static attachmentSelector(): string;
|
|
14
|
+
static selector(): string;
|
|
15
|
+
readonly node: Html5Node;
|
|
16
|
+
/** @internal */
|
|
17
|
+
private _attachments?;
|
|
18
|
+
constructor(node: Html5Node);
|
|
19
|
+
attachments(): Promise<Array<Attachment | null>>;
|
|
20
|
+
size(): Promise<number>;
|
|
21
|
+
inspect(): Promise<string>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=attachment-gallery.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Html5Node } from "@blazetrails/nokogiri";
|
|
2
|
+
import { TrixConversion } from "./attachments/trix-conversion.js";
|
|
3
|
+
import type { Fragment } from "./fragment.js";
|
|
4
|
+
type Attachable = object & {
|
|
5
|
+
toRichTextAttributes(attributes?: Record<string, unknown>): Record<string, unknown>;
|
|
6
|
+
};
|
|
7
|
+
export interface Attachment {
|
|
8
|
+
toParam(): unknown;
|
|
9
|
+
cacheKey(...args: unknown[]): string;
|
|
10
|
+
toTrixAttachment(content?: unknown): ReturnType<(typeof TrixConversion)["toTrixAttachment"]>;
|
|
11
|
+
}
|
|
12
|
+
export declare class Attachment {
|
|
13
|
+
static tagName: string;
|
|
14
|
+
static fragmentByMinifyingAttachments: (content: unknown) => Promise<Fragment>;
|
|
15
|
+
static fragmentByConvertingTrixAttachments: (content: unknown) => Promise<Fragment>;
|
|
16
|
+
static fromTrixAttachment: (trixAttachment: unknown) => Promise<Attachment | null>;
|
|
17
|
+
static readonly ATTRIBUTES: string[];
|
|
18
|
+
static fragmentByCanonicalizingAttachments(content: unknown): Promise<Fragment>;
|
|
19
|
+
static fromNode(node: Html5Node, attachable?: unknown): Promise<Attachment>;
|
|
20
|
+
static fromAttachables(attachables: unknown): Attachment[];
|
|
21
|
+
static fromAttachable(attachable: Attachable, attributes?: Record<string, unknown>): Attachment | null;
|
|
22
|
+
static fromAttributes(attributes: Record<string, unknown>, attachable?: unknown): Promise<Attachment | null>;
|
|
23
|
+
/** @internal */
|
|
24
|
+
private static nodeFromAttributes;
|
|
25
|
+
/** @internal */
|
|
26
|
+
private static processAttributes;
|
|
27
|
+
readonly node: Html5Node;
|
|
28
|
+
readonly attachable: unknown;
|
|
29
|
+
/** @internal */
|
|
30
|
+
private _nodeAttributes?;
|
|
31
|
+
/** @internal */
|
|
32
|
+
private _attachableAttributes?;
|
|
33
|
+
/** @internal */
|
|
34
|
+
private _sgidAttributes?;
|
|
35
|
+
constructor(node: Html5Node, attachable: unknown);
|
|
36
|
+
get caption(): string | null;
|
|
37
|
+
fullAttributes(): Record<string, unknown>;
|
|
38
|
+
withFullAttributes(): Promise<Attachment | null>;
|
|
39
|
+
toPlainText(): Promise<string>;
|
|
40
|
+
toHtml(): string;
|
|
41
|
+
toString(): string;
|
|
42
|
+
inspect(): string;
|
|
43
|
+
/** @internal */
|
|
44
|
+
private nodeAttributes;
|
|
45
|
+
/** @internal */
|
|
46
|
+
private attachableAttributes;
|
|
47
|
+
/** @internal */
|
|
48
|
+
private sgidAttributes;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=attachment.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Html5Node } from "@blazetrails/nokogiri";
|
|
2
|
+
interface CachingHost {
|
|
3
|
+
node: Html5Node;
|
|
4
|
+
attachable: {
|
|
5
|
+
cacheKey(...args: unknown[]): unknown;
|
|
6
|
+
};
|
|
7
|
+
cacheDigest(): string;
|
|
8
|
+
}
|
|
9
|
+
export declare const Caching: {
|
|
10
|
+
cacheKey(this: CachingHost, ...args: unknown[]): string;
|
|
11
|
+
/** @internal */
|
|
12
|
+
cacheDigest(this: CachingHost): string;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=caching.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Concern, type Extended } from "@blazetrails/activesupport";
|
|
2
|
+
import { TrixAttachment } from "../trix-attachment.js";
|
|
3
|
+
interface TrixConversionHost {
|
|
4
|
+
attachable: object;
|
|
5
|
+
fullAttributes(): Record<string, unknown>;
|
|
6
|
+
modelName: {
|
|
7
|
+
element: string;
|
|
8
|
+
};
|
|
9
|
+
trixAttachmentContent(): unknown;
|
|
10
|
+
}
|
|
11
|
+
export declare const TrixConversion: Extended<typeof Concern> & {
|
|
12
|
+
ClassMethods: Record<string, unknown>;
|
|
13
|
+
toTrixAttachment(this: TrixConversionHost, content?: unknown): Promise<TrixAttachment>;
|
|
14
|
+
trixAttachmentContent(this: TrixConversionHost): unknown;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=trix-conversion.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Base, Relation } from "@blazetrails/activerecord";
|
|
2
|
+
import { Concern, type Extended } from "@blazetrails/activesupport";
|
|
3
|
+
type HasRichTextOptions = {
|
|
4
|
+
encrypted?: boolean;
|
|
5
|
+
strictLoading?: boolean;
|
|
6
|
+
storeIfBlank?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare function hasRichText(this: typeof Base, name: string, { encrypted, strictLoading, storeIfBlank, }?: HasRichTextOptions): void;
|
|
9
|
+
declare function withAllRichText(this: typeof Base): Relation<Base>;
|
|
10
|
+
declare function richTextAssociationNames(this: typeof Base): string[];
|
|
11
|
+
declare const ClassMethods: {
|
|
12
|
+
hasRichText: typeof hasRichText;
|
|
13
|
+
withAllRichText: typeof withAllRichText;
|
|
14
|
+
richTextAssociationNames: typeof richTextAssociationNames;
|
|
15
|
+
};
|
|
16
|
+
declare module "@blazetrails/activerecord/base.js" {
|
|
17
|
+
namespace Base {
|
|
18
|
+
const hasRichText: typeof ClassMethods.hasRichText;
|
|
19
|
+
const withAllRichText: typeof ClassMethods.withAllRichText;
|
|
20
|
+
const richTextAssociationNames: typeof ClassMethods.richTextAssociationNames;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export declare const Attribute: Extended<typeof Concern> & {
|
|
24
|
+
ClassMethods: typeof ClassMethods;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=attribute.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { htmlSafe, type Included } from "@blazetrails/activesupport";
|
|
2
|
+
import { Attachment } from "./attachment.js";
|
|
3
|
+
import { ContentHelper } from "./app/helpers/action-text/content-helper.js";
|
|
4
|
+
import { AttachmentGallery } from "./attachment-gallery.js";
|
|
5
|
+
import { Fragment } from "./fragment.js";
|
|
6
|
+
import { Rendering, type RenderingClassMethods } from "./rendering.js";
|
|
7
|
+
interface ContentOptions {
|
|
8
|
+
canonicalize?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface Content extends Included<typeof Rendering>, ContentHelper {
|
|
11
|
+
_dump(...args: unknown[]): string | null;
|
|
12
|
+
render(...args: unknown[]): unknown;
|
|
13
|
+
}
|
|
14
|
+
export declare class Content {
|
|
15
|
+
static renderer: RenderingClassMethods["renderer"];
|
|
16
|
+
static actionControllerRenderer: RenderingClassMethods["actionControllerRenderer"];
|
|
17
|
+
static withRenderer: RenderingClassMethods["withRenderer"];
|
|
18
|
+
static render: RenderingClassMethods["render"];
|
|
19
|
+
static load: (content: unknown) => unknown;
|
|
20
|
+
static dump: (content: unknown) => string | null | Promise<string | null>;
|
|
21
|
+
static _load: (content: unknown) => unknown;
|
|
22
|
+
static fragmentByCanonicalizingContent(content: unknown): Promise<Fragment>;
|
|
23
|
+
fragment: Fragment;
|
|
24
|
+
/** @internal */
|
|
25
|
+
private _links?;
|
|
26
|
+
/** @internal */
|
|
27
|
+
private _attachments?;
|
|
28
|
+
/** @internal */
|
|
29
|
+
private _attachmentGalleries?;
|
|
30
|
+
/** @internal */
|
|
31
|
+
private _galleryAttachments?;
|
|
32
|
+
/** @internal */
|
|
33
|
+
private _attachables?;
|
|
34
|
+
/** @internal */
|
|
35
|
+
private _attachmentNodes?;
|
|
36
|
+
/** @internal */
|
|
37
|
+
private _attachmentGalleryNodes?;
|
|
38
|
+
protected constructor();
|
|
39
|
+
static new(content?: unknown, options?: ContentOptions): Promise<Content>;
|
|
40
|
+
links(): string[];
|
|
41
|
+
attachments(): Promise<Array<Attachment | null>>;
|
|
42
|
+
attachmentGalleries(): Promise<AttachmentGallery[]>;
|
|
43
|
+
galleryAttachments(): Promise<Array<Attachment | null>>;
|
|
44
|
+
attachables(): Promise<unknown[]>;
|
|
45
|
+
appendAttachables(attachables: unknown): Promise<Content>;
|
|
46
|
+
renderAttachments(options: {
|
|
47
|
+
withFullAttributes?: boolean;
|
|
48
|
+
} | undefined, block: (attachment: Attachment | null) => unknown): Promise<Content>;
|
|
49
|
+
renderAttachmentGalleries(block: (attachmentGallery: AttachmentGallery) => unknown): Promise<Content>;
|
|
50
|
+
toPlainText(): Promise<string>;
|
|
51
|
+
toTrixHtml(): Promise<string>;
|
|
52
|
+
toHtml(): string;
|
|
53
|
+
toRenderedHtmlWithLayout(): unknown;
|
|
54
|
+
toPartialPath(): string;
|
|
55
|
+
toString(): unknown;
|
|
56
|
+
asJson(..._args: unknown[]): string;
|
|
57
|
+
inspect(): string;
|
|
58
|
+
equals(other: unknown): boolean | Promise<boolean> | null;
|
|
59
|
+
isBlank(): boolean;
|
|
60
|
+
isEmpty(): boolean;
|
|
61
|
+
htmlSafe(): ReturnType<typeof htmlSafe>;
|
|
62
|
+
isPresent(): boolean;
|
|
63
|
+
/** @internal */
|
|
64
|
+
private attachmentNodes;
|
|
65
|
+
/** @internal */
|
|
66
|
+
private attachmentGalleryNodes;
|
|
67
|
+
/** @internal */
|
|
68
|
+
private attachmentForNode;
|
|
69
|
+
/** @internal */
|
|
70
|
+
private attachmentGalleryForNode;
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=content.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Migration } from "@blazetrails/activerecord";
|
|
2
|
+
declare const CreateActionTextTables_base: typeof Migration;
|
|
3
|
+
export declare class CreateActionTextTables extends CreateActionTextTables_base {
|
|
4
|
+
change(): Promise<void>;
|
|
5
|
+
/** @internal */
|
|
6
|
+
private primaryAndForeignKeyTypes;
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=20180528164100_create_action_text_tables.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Base } from "@blazetrails/activerecord";
|
|
2
|
+
import type { EncryptedRichText } from "./encrypted-rich-text.js";
|
|
3
|
+
type EncryptionHost = Base & {
|
|
4
|
+
encryptRichTexts(): Promise<EncryptedRichText[]>;
|
|
5
|
+
decryptRichTexts(): Promise<EncryptedRichText[]>;
|
|
6
|
+
hasEncryptedRichTexts(): Promise<boolean>;
|
|
7
|
+
encryptableRichTexts(): Promise<EncryptedRichText[]>;
|
|
8
|
+
/** @internal */
|
|
9
|
+
_encryptableRichTexts?: EncryptedRichText[];
|
|
10
|
+
};
|
|
11
|
+
declare function encrypt(this: EncryptionHost): Promise<unknown>;
|
|
12
|
+
declare function decrypt(this: EncryptionHost): Promise<unknown>;
|
|
13
|
+
/** @internal */
|
|
14
|
+
declare function encryptRichTexts(this: EncryptionHost): Promise<EncryptedRichText[]>;
|
|
15
|
+
/** @internal */
|
|
16
|
+
declare function decryptRichTexts(this: EncryptionHost): Promise<EncryptedRichText[]>;
|
|
17
|
+
/** @internal */
|
|
18
|
+
declare function hasEncryptedRichTexts(this: EncryptionHost): Promise<boolean>;
|
|
19
|
+
/** @internal */
|
|
20
|
+
declare function encryptableRichTexts(this: EncryptionHost): Promise<EncryptedRichText[]>;
|
|
21
|
+
export declare const Encryption: {
|
|
22
|
+
encrypt: typeof encrypt;
|
|
23
|
+
decrypt: typeof decrypt;
|
|
24
|
+
encryptRichTexts: typeof encryptRichTexts;
|
|
25
|
+
decryptRichTexts: typeof decryptRichTexts;
|
|
26
|
+
hasEncryptedRichTexts: typeof hasEncryptedRichTexts;
|
|
27
|
+
encryptableRichTexts: typeof encryptableRichTexts;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=encryption.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import "./constants.engine.generated.js";
|
|
2
|
+
import { OrderedOptions } from "@blazetrails/activesupport";
|
|
3
|
+
import "@blazetrails/trailties/trailties/action-controller";
|
|
4
|
+
import "@blazetrails/trailties/trailties/active-record";
|
|
5
|
+
import { Engine as TrailsEngine } from "@blazetrails/trailties/engine";
|
|
6
|
+
import "@blazetrails/activestorage/engine";
|
|
7
|
+
import { ContentHelper } from "./app/helpers/action-text/content-helper.js";
|
|
8
|
+
import "./app/helpers/action-text/tag-helper.js";
|
|
9
|
+
import "./deprecator.js";
|
|
10
|
+
export interface ActionTextConfig extends OrderedOptions {
|
|
11
|
+
attachmentTagName?: string;
|
|
12
|
+
sanitizerVendor?: {
|
|
13
|
+
safeListSanitizer: new () => ContentHelper["sanitizer"];
|
|
14
|
+
} | null;
|
|
15
|
+
}
|
|
16
|
+
declare module "@blazetrails/trailties/trailtie/configuration" {
|
|
17
|
+
interface Configuration {
|
|
18
|
+
actionText: ActionTextConfig;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
declare module "@blazetrails/ruby-compat/object" {
|
|
22
|
+
interface TrailsConfiguration {
|
|
23
|
+
actionText: ActionTextConfig;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export declare class Engine extends TrailsEngine {
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Html5DocumentFragment, type Html5Node } from "@blazetrails/nokogiri";
|
|
2
|
+
export declare class Fragment {
|
|
3
|
+
deconstruct: () => Html5Node[];
|
|
4
|
+
static wrap(fragmentOrHtml: unknown): Fragment;
|
|
5
|
+
static fromHtml(html: unknown): Fragment;
|
|
6
|
+
readonly source: Html5DocumentFragment;
|
|
7
|
+
/** @internal */
|
|
8
|
+
protected plainText: string | null;
|
|
9
|
+
/** @internal */
|
|
10
|
+
protected html: string | null;
|
|
11
|
+
constructor(source: Html5DocumentFragment);
|
|
12
|
+
findAll(selector: string): import("@blazetrails/nokogiri").NodeSet;
|
|
13
|
+
update(block: (source: Html5DocumentFragment) => unknown): Promise<Fragment>;
|
|
14
|
+
replace(selector: string, block: (node: Html5Node) => unknown): Promise<Fragment>;
|
|
15
|
+
toPlainText(): string;
|
|
16
|
+
toHtml(): string;
|
|
17
|
+
toString(): string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=fragment.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Gem } from "@blazetrails/ruby-compat";
|
|
2
|
+
export declare function gemVersion(): InstanceType<typeof Gem.Version>;
|
|
3
|
+
export declare const VERSION: {
|
|
4
|
+
MAJOR: number;
|
|
5
|
+
MINOR: number;
|
|
6
|
+
TINY: number;
|
|
7
|
+
PRE: string;
|
|
8
|
+
STRING: string;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=gem-version.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "../../../constants.action-text-install-install-generator.generated.js";
|
|
2
|
+
import type * as ThorActions from "@blazetrails/thor/actions";
|
|
3
|
+
import { Base } from "@blazetrails/trailties/generators";
|
|
4
|
+
export declare class InstallGenerator extends Base {
|
|
5
|
+
run: OmitThisParameter<typeof ThorActions.run>;
|
|
6
|
+
insertIntoFile: OmitThisParameter<typeof ThorActions.Actions.insertIntoFile>;
|
|
7
|
+
copyFile: OmitThisParameter<typeof ThorActions.Actions.copyFile>;
|
|
8
|
+
uncommentLines: OmitThisParameter<typeof ThorActions.Actions.uncommentLines>;
|
|
9
|
+
/** @internal */
|
|
10
|
+
private _usingJsRuntime?;
|
|
11
|
+
/** @internal */
|
|
12
|
+
private _usingBun?;
|
|
13
|
+
/** @internal */
|
|
14
|
+
private _usingNode?;
|
|
15
|
+
/** @missingRailsArgs run — PERMANENT */
|
|
16
|
+
installJavascriptDependencies(): Promise<void>;
|
|
17
|
+
appendJavascriptDependencies(): Promise<void>;
|
|
18
|
+
createActiontextFiles(): Promise<void>;
|
|
19
|
+
enableImageProcessingGem(): Promise<void>;
|
|
20
|
+
createMigrations(): Promise<void>;
|
|
21
|
+
isUsingJsRuntime(): Promise<boolean>;
|
|
22
|
+
isUsingBun(): Promise<boolean>;
|
|
23
|
+
isUsingNode(): Promise<boolean>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=install-generator.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Html5DocumentFragment, type Html5Node } from "@blazetrails/nokogiri";
|
|
2
|
+
export declare const HtmlConversion: {
|
|
3
|
+
nodeToHtml(node: Html5Node | Html5DocumentFragment): string;
|
|
4
|
+
fragmentForHtml(html: string): Html5DocumentFragment;
|
|
5
|
+
createElement(tagName: string, attributes?: Record<string, unknown>): Html5Node;
|
|
6
|
+
/** @internal */
|
|
7
|
+
document(): import("@blazetrails/nokogiri").Html5Document;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=html-conversion.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { ActionText } from "./action-text.js";
|
|
2
|
+
export { VERSION, gemVersion } from "./gem-version.js";
|
|
3
|
+
export { version } from "./version.js";
|
|
4
|
+
export { deprecator } from "./deprecator.js";
|
|
5
|
+
import "./constants.generated.js";
|
|
6
|
+
export { Content } from "./content.js";
|
|
7
|
+
export { Fragment } from "./fragment.js";
|
|
8
|
+
export { Rendering } from "./rendering.js";
|
|
9
|
+
export { Serialization } from "./serialization.js";
|
|
10
|
+
export { Attribute } from "./attribute.js";
|
|
11
|
+
export { HtmlConversion } from "./html-conversion.js";
|
|
12
|
+
export { PlainTextConversion } from "./plain-text-conversion.js";
|
|
13
|
+
export { Attachment } from "./attachment.js";
|
|
14
|
+
export { AttachmentGallery } from "./attachment-gallery.js";
|
|
15
|
+
export { TrixAttachment } from "./trix-attachment.js";
|
|
16
|
+
export { Attachable } from "./attachable.js";
|
|
17
|
+
export { ContentAttachment } from "./attachables/content-attachment.js";
|
|
18
|
+
export { MissingAttachable } from "./attachables/missing-attachable.js";
|
|
19
|
+
export { RemoteImage } from "./attachables/remote-image.js";
|
|
20
|
+
export { ContentHelper } from "./app/helpers/action-text/content-helper.js";
|
|
21
|
+
export { TagHelper } from "./app/helpers/action-text/tag-helper.js";
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Html5DocumentFragment, Html5Node } from "@blazetrails/nokogiri";
|
|
2
|
+
type PlainTextNode = Html5Node | Html5DocumentFragment;
|
|
3
|
+
export declare const PlainTextConversion: {
|
|
4
|
+
nodeToPlainText(node: PlainTextNode): string;
|
|
5
|
+
/** @internal */
|
|
6
|
+
plainTextForNode(node: PlainTextNode, index?: number): string;
|
|
7
|
+
/** @internal */
|
|
8
|
+
plainTextForNodeChildren(node: PlainTextNode): string;
|
|
9
|
+
/** @internal */
|
|
10
|
+
plainTextMethodForNode(node: PlainTextNode): string;
|
|
11
|
+
/** @internal */
|
|
12
|
+
plainTextForBlock(node: PlainTextNode, _index?: number): string;
|
|
13
|
+
/** @internal */
|
|
14
|
+
plainTextForList(node: Html5Node, _index: number): string;
|
|
15
|
+
/** @internal */
|
|
16
|
+
plainTextForBrNode(_node: Html5Node, _index: number): string;
|
|
17
|
+
/** @internal */
|
|
18
|
+
plainTextForTextNode(node: Html5Node, _index: number): string;
|
|
19
|
+
/** @internal */
|
|
20
|
+
plainTextForDivNode(node: Html5Node, _index: number): string;
|
|
21
|
+
/** @internal */
|
|
22
|
+
plainTextForFigcaptionNode(node: Html5Node, _index: number): string;
|
|
23
|
+
/** @internal */
|
|
24
|
+
plainTextForBlockquoteNode(node: Html5Node, _index: number): string;
|
|
25
|
+
/** @internal */
|
|
26
|
+
plainTextForLiNode(node: Html5Node, index: number): string;
|
|
27
|
+
/** @internal */
|
|
28
|
+
removeTrailingNewlines(text: string): string;
|
|
29
|
+
/** @internal */
|
|
30
|
+
bulletForLiNode(node: Html5Node, index: number): string;
|
|
31
|
+
/** @internal */
|
|
32
|
+
listNodeNameForLiNode(node: Html5Node): string | null;
|
|
33
|
+
/** @internal */
|
|
34
|
+
indentationForLiNode(node: Html5Node): string | null;
|
|
35
|
+
/** @internal */
|
|
36
|
+
listNodeDepthForNode(node: Html5Node): number;
|
|
37
|
+
/** @internal */
|
|
38
|
+
breakIfNestedList(node: Html5Node, text: string): string;
|
|
39
|
+
};
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=plain-text-conversion.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Concern, type Extended } from "@blazetrails/activesupport";
|
|
2
|
+
interface RendererLike {
|
|
3
|
+
renderToString(...args: unknown[]): unknown;
|
|
4
|
+
}
|
|
5
|
+
export declare const Rendering: {
|
|
6
|
+
ClassMethods: Record<string, unknown>;
|
|
7
|
+
} & Extended<typeof Concern>;
|
|
8
|
+
export interface RenderingClassMethods {
|
|
9
|
+
renderer: RendererLike | null;
|
|
10
|
+
actionControllerRenderer(): RendererLike;
|
|
11
|
+
withRenderer<T>(renderer: RendererLike | null, block: () => T): T;
|
|
12
|
+
render(...args: unknown[]): unknown;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=rendering.d.ts.map
|