hububb-saas-shared 1.2.53 → 1.2.54
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/schemas/property-guide/body.d.ts +1 -1
- package/dist/schemas/property-guide/body.js +6 -2
- package/dist/schemas/property-guide/index.d.ts +1 -0
- package/dist/schemas/property-guide/index.js +4 -1
- package/dist/schemas/property-guide/links.d.ts +2 -0
- package/dist/schemas/property-guide/links.js +22 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ export declare function htmlToMarkdown(html: string): string;
|
|
|
9
9
|
export declare function normalizeGuideBodyMarkdown(body: string | null | undefined): string;
|
|
10
10
|
/** @deprecated Use normalizeGuideBodyMarkdown */
|
|
11
11
|
export declare function normalizeGuideBodyForDisplay(body: string | null | undefined): string;
|
|
12
|
-
/** Prepares stored guide body for markdown editors. */
|
|
12
|
+
/** Prepares stored guide body for markdown editors — preserves newlines while typing. */
|
|
13
13
|
export declare function guideBodyToEditorMarkdown(body: string | null | undefined): string;
|
|
14
14
|
/** @deprecated Use guideBodyToEditorMarkdown */
|
|
15
15
|
export declare function guideBodyToEditorHtml(body: string | null | undefined): string;
|
|
@@ -65,9 +65,13 @@ function normalizeGuideBodyMarkdown(body) {
|
|
|
65
65
|
function normalizeGuideBodyForDisplay(body) {
|
|
66
66
|
return normalizeGuideBodyMarkdown(body);
|
|
67
67
|
}
|
|
68
|
-
/** Prepares stored guide body for markdown editors. */
|
|
68
|
+
/** Prepares stored guide body for markdown editors — preserves newlines while typing. */
|
|
69
69
|
function guideBodyToEditorMarkdown(body) {
|
|
70
|
-
|
|
70
|
+
if (body == null || body === '')
|
|
71
|
+
return '';
|
|
72
|
+
if (isGuideBodyHtml(body))
|
|
73
|
+
return htmlToMarkdown(body);
|
|
74
|
+
return body;
|
|
71
75
|
}
|
|
72
76
|
/** @deprecated Use guideBodyToEditorMarkdown */
|
|
73
77
|
function guideBodyToEditorHtml(body) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { GUIDE_ICON_KEYS, GUIDE_ICON_LABELS, GUIDE_ICON_PHOSPHOR_NAMES, type GuideIconKey } from './icons';
|
|
2
2
|
export { GUIDE_BODY_ALLOWED_TAGS, escapeGuideHtml, guideBodyToEditorHtml, guideBodyToEditorMarkdown, htmlToMarkdown, isGuideBodyEmpty, isGuideBodyHtml, normalizeGuideBodyForDisplay, normalizeGuideBodyMarkdown, plainTextToGuideHtml, stripGuideBodyPreview, } from './body';
|
|
3
|
+
export { isExternalGuideMarkdownLink, normalizeGuideMarkdownLinkHref, } from './links';
|
|
3
4
|
export declare const propertyGuideSchema: import("zod").ZodObject<{
|
|
4
5
|
id: import("zod").ZodNumber;
|
|
5
6
|
propertyId: import("zod").ZodNumber;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.propertyGuideSchema = exports.stripGuideBodyPreview = exports.plainTextToGuideHtml = exports.normalizeGuideBodyMarkdown = exports.normalizeGuideBodyForDisplay = exports.isGuideBodyHtml = exports.isGuideBodyEmpty = exports.htmlToMarkdown = exports.guideBodyToEditorMarkdown = exports.guideBodyToEditorHtml = exports.escapeGuideHtml = exports.GUIDE_BODY_ALLOWED_TAGS = exports.GUIDE_ICON_PHOSPHOR_NAMES = exports.GUIDE_ICON_LABELS = exports.GUIDE_ICON_KEYS = void 0;
|
|
3
|
+
exports.propertyGuideSchema = exports.normalizeGuideMarkdownLinkHref = exports.isExternalGuideMarkdownLink = exports.stripGuideBodyPreview = exports.plainTextToGuideHtml = exports.normalizeGuideBodyMarkdown = exports.normalizeGuideBodyForDisplay = exports.isGuideBodyHtml = exports.isGuideBodyEmpty = exports.htmlToMarkdown = exports.guideBodyToEditorMarkdown = exports.guideBodyToEditorHtml = exports.escapeGuideHtml = exports.GUIDE_BODY_ALLOWED_TAGS = exports.GUIDE_ICON_PHOSPHOR_NAMES = exports.GUIDE_ICON_LABELS = exports.GUIDE_ICON_KEYS = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const icons_1 = require("./icons");
|
|
6
6
|
var icons_2 = require("./icons");
|
|
@@ -19,6 +19,9 @@ Object.defineProperty(exports, "normalizeGuideBodyForDisplay", { enumerable: tru
|
|
|
19
19
|
Object.defineProperty(exports, "normalizeGuideBodyMarkdown", { enumerable: true, get: function () { return body_1.normalizeGuideBodyMarkdown; } });
|
|
20
20
|
Object.defineProperty(exports, "plainTextToGuideHtml", { enumerable: true, get: function () { return body_1.plainTextToGuideHtml; } });
|
|
21
21
|
Object.defineProperty(exports, "stripGuideBodyPreview", { enumerable: true, get: function () { return body_1.stripGuideBodyPreview; } });
|
|
22
|
+
var links_1 = require("./links");
|
|
23
|
+
Object.defineProperty(exports, "isExternalGuideMarkdownLink", { enumerable: true, get: function () { return links_1.isExternalGuideMarkdownLink; } });
|
|
24
|
+
Object.defineProperty(exports, "normalizeGuideMarkdownLinkHref", { enumerable: true, get: function () { return links_1.normalizeGuideMarkdownLinkHref; } });
|
|
22
25
|
exports.propertyGuideSchema = (0, zod_1.object)({
|
|
23
26
|
id: (0, zod_1.number)().int(),
|
|
24
27
|
propertyId: (0, zod_1.number)().int(),
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeGuideMarkdownLinkHref = normalizeGuideMarkdownLinkHref;
|
|
4
|
+
exports.isExternalGuideMarkdownLink = isExternalGuideMarkdownLink;
|
|
5
|
+
function normalizeGuideMarkdownLinkHref(href) {
|
|
6
|
+
const trimmed = href.trim();
|
|
7
|
+
if (!trimmed)
|
|
8
|
+
return href;
|
|
9
|
+
if (/^(https?:|mailto:|tel:|#)/i.test(trimmed)) {
|
|
10
|
+
return trimmed;
|
|
11
|
+
}
|
|
12
|
+
if (trimmed.startsWith('//')) {
|
|
13
|
+
return `https:${trimmed}`;
|
|
14
|
+
}
|
|
15
|
+
if (trimmed.startsWith('/') || trimmed.startsWith('./') || trimmed.startsWith('../')) {
|
|
16
|
+
return trimmed;
|
|
17
|
+
}
|
|
18
|
+
return `https://${trimmed}`;
|
|
19
|
+
}
|
|
20
|
+
function isExternalGuideMarkdownLink(href) {
|
|
21
|
+
return /^https?:\/\//i.test(href);
|
|
22
|
+
}
|