@aglyn/plugins-ai 1.13.0 → 1.15.0
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/package.json +17 -17
- package/src/lib/components/ai-site-build-page.component.js +5 -3
- package/src/lib/components/ai-site-build-page.component.js.map +1 -1
- package/src/lib/components/ai-site-import-finish.component.d.ts +3 -1
- package/src/lib/components/ai-site-import-finish.component.js +3 -3
- package/src/lib/components/ai-site-import-finish.component.js.map +1 -1
- package/src/lib/components/ai-site-import-job.component.d.ts +4 -3
- package/src/lib/components/ai-site-import-job.component.js +141 -43
- package/src/lib/components/ai-site-import-job.component.js.map +1 -1
- package/src/lib/components/ai-site-import-plan.component.d.ts +42 -0
- package/src/lib/components/ai-site-import-plan.component.js +246 -0
- package/src/lib/components/ai-site-import-plan.component.js.map +1 -0
- package/src/lib/components/ai-site-import-start.component.d.ts +3 -1
- package/src/lib/components/ai-site-import-start.component.js +3 -2
- package/src/lib/components/ai-site-import-start.component.js.map +1 -1
- package/src/lib/components/ai-site-start-card.component.js +6 -2
- package/src/lib/components/ai-site-start-card.component.js.map +1 -1
- package/src/lib/components/ai-site-start-steps.component.d.ts +3 -2
- package/src/lib/components/ai-site-start-steps.component.js +12 -5
- package/src/lib/components/ai-site-start-steps.component.js.map +1 -1
- package/src/lib/jobs/ai-job-import-step.d.ts +47 -2
- package/src/lib/jobs/ai-job-import-step.js +356 -22
- package/src/lib/jobs/ai-job-import-step.js.map +1 -1
- package/src/lib/jobs/ai-job-layout-language.js +4 -1
- package/src/lib/jobs/ai-job-layout-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-language.d.ts +21 -2
- package/src/lib/jobs/ai-job-page-language.js +217 -5
- package/src/lib/jobs/ai-job-page-language.js.map +1 -1
- package/src/lib/jobs/ai-job-page-step.d.ts +7 -0
- package/src/lib/jobs/ai-job-page-step.js +73 -12
- package/src/lib/jobs/ai-job-page-step.js.map +1 -1
- package/src/lib/jobs/ai-job-plan-step.js +4 -2
- package/src/lib/jobs/ai-job-plan-step.js.map +1 -1
- package/src/lib/jobs/ai-job-site-look.js +14 -5
- package/src/lib/jobs/ai-job-site-look.js.map +1 -1
- package/src/lib/jobs/ai-job-text-step.d.ts +10 -2
- package/src/lib/jobs/ai-job-text-step.js.map +1 -1
- package/src/lib/jobs/ai-jobs.js +2 -1
- package/src/lib/jobs/ai-jobs.js.map +1 -1
- package/src/lib/jobs/ai-site-import-compile.d.ts +43 -2
- package/src/lib/jobs/ai-site-import-compile.js +126 -63
- package/src/lib/jobs/ai-site-import-compile.js.map +1 -1
- package/src/lib/jobs/ai-site-import-document.d.ts +25 -1
- package/src/lib/jobs/ai-site-import-document.js +26 -7
- package/src/lib/jobs/ai-site-import-document.js.map +1 -1
- package/src/lib/jobs/ai-site-import-honesty.d.ts +65 -0
- package/src/lib/jobs/ai-site-import-honesty.js +271 -0
- package/src/lib/jobs/ai-site-import-honesty.js.map +1 -0
- package/src/lib/jobs/ai-site-import-improve.d.ts +233 -0
- package/src/lib/jobs/ai-site-import-improve.js +1151 -0
- package/src/lib/jobs/ai-site-import-improve.js.map +1 -0
- package/src/lib/jobs/ai-site-import-look.d.ts +4 -0
- package/src/lib/jobs/ai-site-import-look.js +16 -6
- package/src/lib/jobs/ai-site-import-look.js.map +1 -1
- package/src/lib/jobs/ai-site-import-pictures.d.ts +83 -0
- package/src/lib/jobs/ai-site-import-pictures.js +261 -0
- package/src/lib/jobs/ai-site-import-pictures.js.map +1 -0
- package/src/lib/jobs/ai-site-import-plan.d.ts +78 -0
- package/src/lib/jobs/ai-site-import-plan.js +627 -0
- package/src/lib/jobs/ai-site-import-plan.js.map +1 -0
- package/src/lib/jobs/ai-site-import-wording.js +2 -5
- package/src/lib/jobs/ai-site-import-wording.js.map +1 -1
- package/src/lib/layout-language/ai-layout-compiler.d.ts +6 -0
- package/src/lib/layout-language/ai-layout-compiler.js +100 -14
- package/src/lib/layout-language/ai-layout-compiler.js.map +1 -1
- package/src/lib/layout-language/ai-layout-design.d.ts +9 -0
- package/src/lib/layout-language/ai-layout-design.js +29 -3
- package/src/lib/layout-language/ai-layout-design.js.map +1 -1
- package/src/lib/layout-language/ai-layout-frame-source.d.ts +5 -0
- package/src/lib/layout-language/ai-layout-frame-source.js +4 -2
- package/src/lib/layout-language/ai-layout-frame-source.js.map +1 -1
- package/src/lib/layout-language/ai-layout-frame.d.ts +2 -0
- package/src/lib/layout-language/ai-layout-frame.js +20 -12
- package/src/lib/layout-language/ai-layout-frame.js.map +1 -1
- package/src/lib/layout-language/ai-layout-language.d.ts +16 -2
- package/src/lib/layout-language/ai-layout-language.js +11 -5
- package/src/lib/layout-language/ai-layout-language.js.map +1 -1
- package/src/lib/model/ai-site-import-fidelity.d.ts +71 -0
- package/src/lib/model/ai-site-import-fidelity.js +438 -6
- package/src/lib/model/ai-site-import-fidelity.js.map +1 -1
- package/src/lib/model/ai-site-import-ledger.d.ts +82 -0
- package/src/lib/model/ai-site-import-ledger.js +254 -0
- package/src/lib/model/ai-site-import-ledger.js.map +1 -0
- package/src/lib/model/ai-site-import-view.d.ts +110 -6
- package/src/lib/model/ai-site-import-view.js +166 -13
- package/src/lib/model/ai-site-import-view.js.map +1 -1
- package/src/lib/model/ai-site-import.d.ts +234 -2
- package/src/lib/model/ai-site-import.js +312 -15
- package/src/lib/model/ai-site-import.js.map +1 -1
- package/src/lib/model/ai-site-job.js +4 -0
- package/src/lib/model/ai-site-job.js.map +1 -1
- package/src/lib/model/ai-site-kinds.d.ts +2 -0
- package/src/lib/model/ai-site-kinds.js +7 -0
- package/src/lib/model/ai-site-kinds.js.map +1 -1
- package/src/lib/model/ai-site-look.d.ts +14 -5
- package/src/lib/model/ai-site-look.js +22 -16
- package/src/lib/model/ai-site-look.js.map +1 -1
- package/src/lib/model/ai-site-start.d.ts +37 -7
- package/src/lib/model/ai-site-start.js +54 -10
- package/src/lib/model/ai-site-start.js.map +1 -1
- package/src/lib/model/ai-site-starter-look.d.ts +69 -0
- package/src/lib/model/ai-site-starter-look.js +90 -0
- package/src/lib/model/ai-site-starter-look.js.map +1 -0
- package/src/lib/runtime/ai-doctrine-validators.d.ts +7 -0
- package/src/lib/runtime/ai-doctrine-validators.js +3 -2
- package/src/lib/runtime/ai-doctrine-validators.js.map +1 -1
- package/src/lib/runtime/ai-doctrine.d.ts +10 -0
- package/src/lib/runtime/ai-doctrine.js +16 -2
- package/src/lib/runtime/ai-doctrine.js.map +1 -1
- package/src/lib/runtime/site-inventory.js +2 -3
- package/src/lib/runtime/site-inventory.js.map +1 -1
- package/src/lib/server/ai-jobs-resume.js +12 -3
- package/src/lib/server/ai-jobs-resume.js.map +1 -1
- package/src/lib/server/ai-jobs-route.js +5 -1
- package/src/lib/server/ai-jobs-route.js.map +1 -1
- package/src/lib/server/ai-site-import-route.d.ts +6 -0
- package/src/lib/server/ai-site-import-route.js +8 -1
- package/src/lib/server/ai-site-import-route.js.map +1 -1
- package/src/lib/server/assist-view-context.js +3 -3
- package/src/lib/server/assist-view-context.js.map +1 -1
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.d.ts +57 -7
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.js +277 -21
- package/src/lib/site-import/fixtures/site-import-fidelity-replay.js.map +1 -1
- package/src/lib/site-import/fixtures/site-import-improve-answers.d.ts +33 -0
- package/src/lib/site-import/fixtures/site-import-improve-answers.js +457 -0
- package/src/lib/site-import/fixtures/site-import-improve-answers.js.map +1 -0
- package/src/lib/site-import/fixtures/site-layout-recordings.d.ts +29 -0
- package/src/lib/site-import/fixtures/site-layout-recordings.js +26 -0
- package/src/lib/site-import/fixtures/site-layout-recordings.js.map +1 -1
- package/src/lib/site-import/site-import-concealed.d.ts +30 -0
- package/src/lib/site-import/site-import-concealed.js +231 -0
- package/src/lib/site-import/site-import-concealed.js.map +1 -0
- package/src/lib/site-import/site-import-crawl.d.ts +3 -1
- package/src/lib/site-import/site-import-crawl.js +8 -1
- package/src/lib/site-import/site-import-crawl.js.map +1 -1
- package/src/lib/site-import/site-import-css.js +13 -2
- package/src/lib/site-import/site-import-css.js.map +1 -1
- package/src/lib/site-import/site-import-flag.d.ts +17 -0
- package/src/lib/site-import/site-import-flag.js +15 -0
- package/src/lib/site-import/site-import-flag.js.map +1 -1
- package/src/lib/site-import/site-import-html.d.ts +28 -0
- package/src/lib/site-import/site-import-html.js +246 -49
- package/src/lib/site-import/site-import-html.js.map +1 -1
- package/src/lib/site-import/site-import-layout.js +211 -12
- package/src/lib/site-import/site-import-layout.js.map +1 -1
- package/src/lib/site-import/site-import-page.js +2 -0
- package/src/lib/site-import/site-import-page.js.map +1 -1
- package/src/lib/testing/stand-in-dataset-index.js +6 -2
- package/src/lib/testing/stand-in-dataset-index.js.map +1 -1
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import type { AiJobSummary } from './ai-jobs.types';
|
|
18
|
-
import { type AiSiteImportChoice, type AiSiteImportFinish, type AiSiteImportLeftOutReason, type AiSiteImportState, type AiSiteImportWave } from './ai-site-import';
|
|
18
|
+
import { type AiSiteImportChoice, type AiSiteImportFinish, type AiSiteImportLeftOutReason, type AiSiteImportPage, type AiSiteImportState, type AiSiteImportWave } from './ai-site-import';
|
|
19
19
|
/** A domain ownership claim, as the ownership door answers it. */
|
|
20
20
|
export interface AiSiteImportClaim {
|
|
21
21
|
domain: string;
|
|
@@ -124,8 +124,16 @@ export interface AiSiteImportRowView {
|
|
|
124
124
|
* "Copied as it is" or "Arranged by Aglyn AI", once the step has chosen;
|
|
125
125
|
* "Arranged and reworded by Aglyn AI" once its wave improved its words, and
|
|
126
126
|
* "Arranged by Aglyn AI · Words kept" for a policy page on such a wave (AGL-4152).
|
|
127
|
+
* Under a generative Improve it: "Redesigned by Aglyn AI · 2 new sections",
|
|
128
|
+
* or "Layout kept: the redesign did not pass".
|
|
127
129
|
*/
|
|
128
130
|
build: string | null;
|
|
131
|
+
/** "New: Why us, FAQ (4)": the sections a redesign added (AGL-4152). */
|
|
132
|
+
added?: string | null;
|
|
133
|
+
/** "1 stock photo, 1 generated picture": the pictures a redesign took beside its own (AGL-4152). */
|
|
134
|
+
pictures?: string | null;
|
|
135
|
+
/** A page the site's plan proposed (AGL-4152): it has no old page to open. */
|
|
136
|
+
isNew?: boolean;
|
|
129
137
|
}
|
|
130
138
|
/**
|
|
131
139
|
* "3 photos added", "2 photos added, 1 already in your media library"; with
|
|
@@ -137,6 +145,10 @@ export declare function aiSiteImportPhotosText(photos: {
|
|
|
137
145
|
reused: number;
|
|
138
146
|
skipped?: number;
|
|
139
147
|
} | null | undefined): string | null;
|
|
148
|
+
/** "New: Why us, FAQ (4)": the sections a redesign added, as its row says (AGL-4152). */
|
|
149
|
+
export declare function aiSiteImportAddedText(page: Pick<AiSiteImportPage, 'added'>): string | null;
|
|
150
|
+
/** "1 stock photo, 1 generated picture": what a redesign's pictures came from beside the page's own (AGL-4152). */
|
|
151
|
+
export declare function aiSiteImportPicturesText(page: Pick<AiSiteImportPage, 'pictures'>): string | null;
|
|
140
152
|
/** What the row of a page whose words were improved says in place of its word count (AGL-4152). */
|
|
141
153
|
export declare const AI_SITE_IMPORT_REWORDED_WORDS = "Every fact kept";
|
|
142
154
|
/** One wave's rows, the header and footer first where the wave builds them. */
|
|
@@ -204,10 +216,37 @@ export declare const AI_SITE_IMPORT_FINISH_COPY: {
|
|
|
204
216
|
readonly current: "How your new site looks";
|
|
205
217
|
readonly change: "Change";
|
|
206
218
|
};
|
|
207
|
-
/**
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
219
|
+
/**
|
|
220
|
+
* The same choice under a generative Improve it (AGL-4152): the improve option's
|
|
221
|
+
* and the switch's words; everything else stands. Only drawn under the flag.
|
|
222
|
+
*/
|
|
223
|
+
export declare const AI_SITE_IMPORT_FINISH_COPY_GENERATIVE: {
|
|
224
|
+
readonly improve: {
|
|
225
|
+
readonly label: "Improve it";
|
|
226
|
+
readonly description: `${string} AI plans your menu and footer, and redesigns each page with your pictures and forms, in a theme built around your brand. It shows you the plan before anything is built.`;
|
|
227
|
+
};
|
|
228
|
+
readonly wording: {
|
|
229
|
+
readonly label: "Also write new copy";
|
|
230
|
+
readonly description: `${string} AI writes new headings, paragraphs and sections for your main pages from what your site says. It never makes up a name, number, price, date, testimonial, client, award, credential, address or guarantee. Off, every word stays as you wrote it, and your layout and menu are still redesigned.`;
|
|
231
|
+
};
|
|
232
|
+
readonly heading: "How should your new site look?";
|
|
233
|
+
readonly keep: {
|
|
234
|
+
readonly label: "Keep my site";
|
|
235
|
+
readonly description: `Your pages stay laid out as they are, in your site\u2019s colors, buttons and fonts. ${string} tidies spacing, type and color so every page reads well. Every word stays as you wrote it.`;
|
|
236
|
+
};
|
|
237
|
+
readonly helper: "You can change this before each wave.";
|
|
238
|
+
/** The job page's line before it opens the choice: "How your new site looks: Keep my site". */
|
|
239
|
+
readonly current: "How your new site looks";
|
|
240
|
+
readonly change: "Change";
|
|
241
|
+
};
|
|
242
|
+
/** The choice in a few words: "Keep my site", "Improve it", or "Improve it, and my wording"; under a generative Improve it, "Improve it, with new copy". */
|
|
243
|
+
export declare function aiSiteImportChoiceText(choice: AiSiteImportChoice, options?: {
|
|
244
|
+
generative?: boolean;
|
|
245
|
+
}): string;
|
|
246
|
+
/** How a wave was built, as its heading says it: "Keep my site", "Improved", or "Improved, wording too"; under a generative Improve it, "Redesigned" or "Redesigned, new copy". */
|
|
247
|
+
export declare function aiSiteImportBuiltText(choice: AiSiteImportChoice, options?: {
|
|
248
|
+
generative?: boolean;
|
|
249
|
+
}): string;
|
|
211
250
|
/**
|
|
212
251
|
* A wave's heading (AGL-4152): once it has started, its name and how it was
|
|
213
252
|
* built, "Main pages · Keep my site"; before, its name alone, since how it is
|
|
@@ -215,7 +254,9 @@ export declare function aiSiteImportBuiltText(choice: AiSiteImportChoice): strin
|
|
|
215
254
|
*/
|
|
216
255
|
export declare function aiSiteImportWaveHeading(state: Pick<AiSiteImportState, 'finish' | 'wording'> | null | undefined, wave: AiSiteImportWave): string;
|
|
217
256
|
/** What a running wave's page says it does with each page, the way the wave is built (AGL-4152). */
|
|
218
|
-
export declare function aiSiteImportRunningLede(choice: AiSiteImportChoice
|
|
257
|
+
export declare function aiSiteImportRunningLede(choice: AiSiteImportChoice, options?: {
|
|
258
|
+
generative?: boolean;
|
|
259
|
+
}): string;
|
|
219
260
|
/**
|
|
220
261
|
* What Also improve my wording adds (AGL-4152): for a wave, its pages'
|
|
221
262
|
* rewrites, "Adds about 162 AI credits to this wave."; before the site is
|
|
@@ -238,3 +279,66 @@ export interface AiSiteImportFinishField {
|
|
|
238
279
|
export declare function aiSiteImportFinishFieldOf(state: Pick<AiSiteImportState, 'finish' | 'wording'> | null | undefined): AiSiteImportFinishField;
|
|
239
280
|
/** The choice a field asks for: its wording only under Improve it. */
|
|
240
281
|
export declare function aiSiteImportFieldChoice(field: AiSiteImportFinishField): AiSiteImportChoice;
|
|
282
|
+
/** The "Your new site" panel's words: what the site is, its menu, its main button, its footer, and what its owner may switch. */
|
|
283
|
+
export interface AiSiteImportPlanView {
|
|
284
|
+
what: string;
|
|
285
|
+
audience: string;
|
|
286
|
+
/** Each menu entry: its label and the pages under it; one page is a plain link. */
|
|
287
|
+
menu: Array<{
|
|
288
|
+
label: string;
|
|
289
|
+
pages: string[];
|
|
290
|
+
}>;
|
|
291
|
+
/** "Book a visit → Contact". */
|
|
292
|
+
cta: string | null;
|
|
293
|
+
footer: Array<{
|
|
294
|
+
label: string;
|
|
295
|
+
pages: string[];
|
|
296
|
+
}>;
|
|
297
|
+
/** The page it proposes, whether it was kept or switched off. */
|
|
298
|
+
proposed: {
|
|
299
|
+
title: string;
|
|
300
|
+
purpose: string;
|
|
301
|
+
address: string;
|
|
302
|
+
} | null;
|
|
303
|
+
/** Whether the owner still decides: the plan waits on them. */
|
|
304
|
+
editable: boolean;
|
|
305
|
+
}
|
|
306
|
+
/** The panel's fixed words, one place for its specs and its screen. */
|
|
307
|
+
export declare const AI_SITE_IMPORT_PLAN_COPY_TEXT: {
|
|
308
|
+
readonly heading: "Your new site";
|
|
309
|
+
readonly menu: "Menu";
|
|
310
|
+
readonly cta: "Main button";
|
|
311
|
+
readonly footer: "Footer";
|
|
312
|
+
readonly addPage: "Add this new page";
|
|
313
|
+
readonly addPageHelp: "One new page, written from what your site says. It counts toward your plan’s page limit.";
|
|
314
|
+
readonly pictures: "Create pictures with AI where needed";
|
|
315
|
+
readonly build: "Build my new site";
|
|
316
|
+
readonly whatsNew: "What’s new";
|
|
317
|
+
};
|
|
318
|
+
/** The panel as a plan reads, or `null` with none: every import the flag is off for, and every plan that did not pass. */
|
|
319
|
+
export declare function aiSiteImportPlanViewOf(state: AiSiteImportState | null | undefined): AiSiteImportPlanView | null;
|
|
320
|
+
/** What the plan that did not pass says, or `null`: a plan that passed, and every import with none asked. */
|
|
321
|
+
export declare function aiSiteImportPlanFellBackText(state: Pick<AiSiteImportState, 'plan'> | null | undefined): string | null;
|
|
322
|
+
/** The credits a generated picture is quoted at, on a paid plan: an import is one. */
|
|
323
|
+
export declare const aiSiteImportPictureCredits: () => number;
|
|
324
|
+
/** What the generated pictures switch says it adds: how many at most, and what each costs, before it is on. */
|
|
325
|
+
export declare function aiSiteImportPicturesSwitchText(state: AiSiteImportState): string;
|
|
326
|
+
/** Whether generated pictures are switched on now, for the panel's first draw. */
|
|
327
|
+
export declare function aiSiteImportPlanFieldOf(state: AiSiteImportState | null | undefined): {
|
|
328
|
+
addPage: boolean;
|
|
329
|
+
pictures: boolean;
|
|
330
|
+
};
|
|
331
|
+
/** Whether a plan's generated pictures switch means anything: only pages with new copy ask for a picture. */
|
|
332
|
+
export declare function aiSiteImportPlanTakesPictures(state: Pick<AiSiteImportState, 'pages'>): boolean;
|
|
333
|
+
/** The wave's quote as the plan's switches stand now (AGL-4152), before they are saved: with or without its new page, and its pictures. */
|
|
334
|
+
export declare function aiSiteImportPlanQuote(job: Pick<AiJobSummary, 'items' | 'siteImport'>, field: {
|
|
335
|
+
addPage: boolean;
|
|
336
|
+
pictures: boolean;
|
|
337
|
+
}): string | null;
|
|
338
|
+
/** One page's lines of a wave's "What's new" (AGL-4152): its new sections, and its pictures. */
|
|
339
|
+
export interface AiSiteImportWhatsNewLine {
|
|
340
|
+
page: string;
|
|
341
|
+
lines: string[];
|
|
342
|
+
}
|
|
343
|
+
/** A wave's "What's new" (AGL-4152): what its redesigns added, page by page. Empty on every other wave. */
|
|
344
|
+
export declare function aiSiteImportWhatsNew(state: AiSiteImportState, wave: AiSiteImportWave): AiSiteImportWhatsNewLine[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
1
2
|
/**
|
|
2
3
|
* @license
|
|
3
4
|
* Copyright 2026 Aglyn LLC
|
|
@@ -23,7 +24,8 @@
|
|
|
23
24
|
* specs hold them.
|
|
24
25
|
*=========================================*/ import { PLATFORM_BRAND_NAME } from "@aglyn/aglyn/app-utils/platform-brand";
|
|
25
26
|
import { aiCreditRangeText } from "./ai-credit-estimate.js";
|
|
26
|
-
import {
|
|
27
|
+
import { aiMediaCreditsPerPicture } from "./ai-media-credits.js";
|
|
28
|
+
import { AI_SITE_IMPORT_FRAME_SLOT, AI_SITE_IMPORT_GENERATED_PICTURES_PER_PAGE, AI_SITE_IMPORT_LAYOUT_KEPT, AI_SITE_IMPORT_PLAN_FELL_BACK, AI_SITE_IMPORT_LEFT_OUT_COPY, AI_SITE_IMPORT_LEFT_OUT_REASONS, AI_SITE_IMPORT_DEFAULT_CHOICE, AI_SITE_IMPORT_UNREAD_REASONS, aiSiteImportChoiceOf, aiSiteImportGeneratedPicturesOn, aiSiteImportNextWave, aiSiteImportPagesText, aiSiteImportPlanAccepted, aiSiteImportPlanAwaits, aiSiteImportQuoteText, aiSiteImportReadStops, aiSiteImportReadVerdictMessage, aiSiteImportReadVerdictReason, aiSiteImportRemainingCreditRange, aiSiteImportReviewWave, aiSiteImportRunningWave, aiSiteImportWaveChoice, aiSiteImportWaveCreditRange, aiSiteImportWaveIsGenerative, aiSiteImportWaveOwed, aiSiteImportWordingCredits, aiSiteImportWordingPages } from "./ai-site-import.js";
|
|
27
29
|
/** What the card says to a plan that does not include it. */ export const AI_SITE_IMPORT_PLAN_COPY = 'Bring your current website in, every page and photo, on any paid plan. Upgrade to bring yours in.';
|
|
28
30
|
/** What the card says to a member who cannot. */ export const AI_SITE_IMPORT_ROLE_COPY = 'Only the workspace owner or an admin can bring a site in.';
|
|
29
31
|
/**
|
|
@@ -131,15 +133,40 @@ function rowState(row, active) {
|
|
|
131
133
|
const BUILD_COPY = {
|
|
132
134
|
copied: 'Copied as it is',
|
|
133
135
|
arranged: `Arranged by ${PLATFORM_BRAND_NAME} AI`,
|
|
136
|
+
/** A main page redesigned from its ledger (AGL-4152). */ redesigned: `Redesigned by ${PLATFORM_BRAND_NAME} AI`,
|
|
134
137
|
/** A main page whose wording was improved (AGL-4152). */ reworded: `Arranged and reworded by ${PLATFORM_BRAND_NAME} AI`,
|
|
135
138
|
/** A policy page on a wave that improved the wording of the rest: it keeps every word. */ wordsKept: `Arranged by ${PLATFORM_BRAND_NAME} AI · Words kept`
|
|
136
139
|
};
|
|
137
|
-
/** A page's build as its row says it, with whether its words were improved where its wave improved wording (AGL-4152). */ function buildCopy(page, choice) {
|
|
140
|
+
/** A page's build as its row says it, with whether its words were improved where its wave improved wording (AGL-4152). */ function buildCopy(page, choice, generative = false) {
|
|
138
141
|
if (!page.build) return null;
|
|
142
|
+
// A redesign that did not pass (AGL-4152): today's compile drew the page.
|
|
143
|
+
if (page.redesign === 'layout-kept') return AI_SITE_IMPORT_LAYOUT_KEPT;
|
|
144
|
+
if (page.redesign === 'redesigned') {
|
|
145
|
+
var _ref;
|
|
146
|
+
var _page_added;
|
|
147
|
+
const added = (_ref = (_page_added = page.added) == null ? void 0 : _page_added.length) != null ? _ref : 0;
|
|
148
|
+
return added ? `${BUILD_COPY.redesigned} · ${added} new ${added === 1 ? 'section' : 'sections'}` : BUILD_COPY.redesigned;
|
|
149
|
+
}
|
|
150
|
+
if (generative && page.build === 'arranged' && page.wording === 'improved') return BUILD_COPY.redesigned;
|
|
139
151
|
if (page.build === 'arranged' && page.wording === 'improved') return BUILD_COPY.reworded;
|
|
140
152
|
if (page.build === 'arranged' && page.wording === 'kept' && choice.wording) return BUILD_COPY.wordsKept;
|
|
141
153
|
return BUILD_COPY[page.build];
|
|
142
154
|
}
|
|
155
|
+
/** "New: Why us, FAQ (4)": the sections a redesign added, as its row says (AGL-4152). */ export function aiSiteImportAddedText(page) {
|
|
156
|
+
var _page_added;
|
|
157
|
+
const added = (_page_added = page.added) != null ? _page_added : [];
|
|
158
|
+
return added.length ? `New: ${added.map((section)=>section.items ? `${section.heading} (${section.items})` : section.heading).join(', ')}` : null;
|
|
159
|
+
}
|
|
160
|
+
/** "1 stock photo, 1 generated picture": what a redesign's pictures came from beside the page's own (AGL-4152). */ export function aiSiteImportPicturesText(page) {
|
|
161
|
+
const pictures = page.pictures;
|
|
162
|
+
if (!pictures) return null;
|
|
163
|
+
const parts = [
|
|
164
|
+
pictures.stock ? `${pictures.stock} stock ${pictures.stock === 1 ? 'photo' : 'photos'}` : '',
|
|
165
|
+
pictures.generated ? `${pictures.generated} generated ${pictures.generated === 1 ? 'picture' : 'pictures'}` : '',
|
|
166
|
+
pictures.unplaced.length ? `${pictures.unplaced.length} of your photos not placed` : ''
|
|
167
|
+
].filter(Boolean);
|
|
168
|
+
return parts.length ? parts.join(', ') : null;
|
|
169
|
+
}
|
|
143
170
|
/** What the row of a page whose words were improved says in place of its word count (AGL-4152). */ export const AI_SITE_IMPORT_REWORDED_WORDS = 'Every fact kept';
|
|
144
171
|
/** One wave's rows, the header and footer first where the wave builds them. */ export function aiSiteImportWaveRows(job, wave) {
|
|
145
172
|
var _job_items;
|
|
@@ -157,6 +184,7 @@ const BUILD_COPY = {
|
|
|
157
184
|
};
|
|
158
185
|
const rows = [];
|
|
159
186
|
const choice = aiSiteImportWaveChoice(state, wave);
|
|
187
|
+
const generative = aiSiteImportWaveIsGenerative(state, wave);
|
|
160
188
|
if (wave.frame && state.frame) {
|
|
161
189
|
var _ref, _ref1, _ref2;
|
|
162
190
|
var _row_failure;
|
|
@@ -181,21 +209,28 @@ const BUILD_COPY = {
|
|
|
181
209
|
const page = state.pages.find((entry)=>entry.slot === slot);
|
|
182
210
|
if (!page) continue;
|
|
183
211
|
const row = items.get(slot);
|
|
184
|
-
rows.push({
|
|
212
|
+
rows.push(_extends({
|
|
185
213
|
slot,
|
|
186
214
|
title: page.title,
|
|
187
215
|
from: page.path,
|
|
188
216
|
to: page.slug === '/' ? '/' : `/${page.slug}`,
|
|
189
217
|
state: rowState(row, active(row)),
|
|
190
|
-
note: (_ref3 = (_ref4 = row == null ? void 0 : (_row_failure1 = row.failure) == null ? void 0 : _row_failure1.message) != null ? _ref4 : row == null ? void 0 : row.note) != null ? _ref3 : page.refused ? AI_SITE_IMPORT_LEFT_OUT_COPY[page.refused] : null
|
|
218
|
+
note: (_ref3 = (_ref4 = row == null ? void 0 : (_row_failure1 = row.failure) == null ? void 0 : _row_failure1.message) != null ? _ref4 : row == null ? void 0 : row.note) != null ? _ref3 : page.refused ? AI_SITE_IMPORT_LEFT_OUT_COPY[page.refused] : null
|
|
219
|
+
}, aiSiteImportAddedText(page) ? {
|
|
220
|
+
added: aiSiteImportAddedText(page)
|
|
221
|
+
} : {}, aiSiteImportPicturesText(page) ? {
|
|
222
|
+
pictures: aiSiteImportPicturesText(page)
|
|
223
|
+
} : {}, page.origin === 'proposed' ? {
|
|
224
|
+
isNew: true
|
|
225
|
+
} : {}, {
|
|
191
226
|
photos: aiSiteImportPhotosText(page.photos),
|
|
192
227
|
outputId: (_ref5 = row == null ? void 0 : row.outputs[0]) != null ? _ref5 : null,
|
|
193
228
|
oldPage: page.url,
|
|
194
229
|
// Beside the old page's own words, its main region's as the wave read them: its menu and footer are the site's (AGL-4084).
|
|
195
230
|
// A page whose words were improved keeps its facts, not its count (AGL-4152).
|
|
196
|
-
words: page.brought ? page.wording === 'improved' ? AI_SITE_IMPORT_REWORDED_WORDS : `${page.brought.words.toLocaleString('en-US')} of ${((_ref6 = (_page_read = page.read) == null ? void 0 : _page_read.words) != null ? _ref6 : page.words).toLocaleString('en-US')} words` : null,
|
|
197
|
-
build: buildCopy(page, choice)
|
|
198
|
-
});
|
|
231
|
+
words: page.brought && page.origin !== 'proposed' ? page.wording === 'improved' ? AI_SITE_IMPORT_REWORDED_WORDS : `${page.brought.words.toLocaleString('en-US')} of ${((_ref6 = (_page_read = page.read) == null ? void 0 : _page_read.words) != null ? _ref6 : page.words).toLocaleString('en-US')} words` : null,
|
|
232
|
+
build: buildCopy(page, choice, generative)
|
|
233
|
+
}));
|
|
199
234
|
}
|
|
200
235
|
return rows;
|
|
201
236
|
}
|
|
@@ -207,7 +242,9 @@ const BUILD_COPY = {
|
|
|
207
242
|
var _job_items, _job_items1;
|
|
208
243
|
const state = job.siteImport;
|
|
209
244
|
const range = aiSiteImportWaveCreditRange(state, wave, (_job_items = job.items) != null ? _job_items : null);
|
|
210
|
-
return aiSiteImportQuoteText(range, aiSiteImportWaveOwed(state, wave, (_job_items1 = job.items) != null ? _job_items1 : null))
|
|
245
|
+
return aiSiteImportQuoteText(range, aiSiteImportWaveOwed(state, wave, (_job_items1 = job.items) != null ? _job_items1 : null), aiSiteImportWaveIsGenerative(state, wave) ? {
|
|
246
|
+
generative: true
|
|
247
|
+
} : {});
|
|
211
248
|
}
|
|
212
249
|
/** What a wave cost, its pages' credits less what was given back. */ export function aiSiteImportWaveSpent(job, wave) {
|
|
213
250
|
var _job_items;
|
|
@@ -324,12 +361,27 @@ const BUILD_COPY = {
|
|
|
324
361
|
/** The job page's line before it opens the choice: "How your new site looks: Keep my site". */ current: 'How your new site looks',
|
|
325
362
|
change: 'Change'
|
|
326
363
|
};
|
|
327
|
-
/**
|
|
364
|
+
/**
|
|
365
|
+
* The same choice under a generative Improve it (AGL-4152): the improve option's
|
|
366
|
+
* and the switch's words; everything else stands. Only drawn under the flag.
|
|
367
|
+
*/ export const AI_SITE_IMPORT_FINISH_COPY_GENERATIVE = _extends({}, AI_SITE_IMPORT_FINISH_COPY, {
|
|
368
|
+
improve: {
|
|
369
|
+
label: 'Improve it',
|
|
370
|
+
description: `${PLATFORM_BRAND_NAME} AI plans your menu and footer, and redesigns each page with your pictures and forms, in a theme built around your brand. It shows you the plan before anything is built.`
|
|
371
|
+
},
|
|
372
|
+
wording: {
|
|
373
|
+
label: 'Also write new copy',
|
|
374
|
+
description: `${PLATFORM_BRAND_NAME} AI writes new headings, paragraphs and sections for your main pages from what your site says. It never makes up a name, number, price, date, testimonial, client, award, credential, address or guarantee. Off, every word stays as you wrote it, and your layout and menu are still redesigned.`
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
/** The choice in a few words: "Keep my site", "Improve it", or "Improve it, and my wording"; under a generative Improve it, "Improve it, with new copy". */ export function aiSiteImportChoiceText(choice, options = {}) {
|
|
328
378
|
if (choice.finish === 'keep') return AI_SITE_IMPORT_FINISH_COPY.keep.label;
|
|
329
|
-
|
|
379
|
+
if (!choice.wording) return AI_SITE_IMPORT_FINISH_COPY.improve.label;
|
|
380
|
+
return options.generative ? `${AI_SITE_IMPORT_FINISH_COPY.improve.label}, with new copy` : `${AI_SITE_IMPORT_FINISH_COPY.improve.label}, and my wording`;
|
|
330
381
|
}
|
|
331
|
-
/** How a wave was built, as its heading says it: "Keep my site", "Improved", or "Improved, wording too". */ export function aiSiteImportBuiltText(choice) {
|
|
382
|
+
/** How a wave was built, as its heading says it: "Keep my site", "Improved", or "Improved, wording too"; under a generative Improve it, "Redesigned" or "Redesigned, new copy". */ export function aiSiteImportBuiltText(choice, options = {}) {
|
|
332
383
|
if (choice.finish === 'keep') return AI_SITE_IMPORT_FINISH_COPY.keep.label;
|
|
384
|
+
if (options.generative) return choice.wording ? 'Redesigned, new copy' : 'Redesigned';
|
|
333
385
|
return choice.wording ? 'Improved, wording too' : 'Improved';
|
|
334
386
|
}
|
|
335
387
|
/**
|
|
@@ -338,11 +390,14 @@ const BUILD_COPY = {
|
|
|
338
390
|
* built is still the owner's to change.
|
|
339
391
|
*/ export function aiSiteImportWaveHeading(state, wave) {
|
|
340
392
|
if (!wave.startedAt) return wave.label;
|
|
341
|
-
return `${wave.label} · ${aiSiteImportBuiltText(aiSiteImportWaveChoice(state, wave)
|
|
393
|
+
return `${wave.label} · ${aiSiteImportBuiltText(aiSiteImportWaveChoice(state, wave), wave.generative ? {
|
|
394
|
+
generative: true
|
|
395
|
+
} : {})}`;
|
|
342
396
|
}
|
|
343
|
-
/** What a running wave's page says it does with each page, the way the wave is built (AGL-4152). */ export function aiSiteImportRunningLede(choice) {
|
|
397
|
+
/** What a running wave's page says it does with each page, the way the wave is built (AGL-4152). */ export function aiSiteImportRunningLede(choice, options = {}) {
|
|
344
398
|
const review = 'You review the wave when it is in.';
|
|
345
399
|
if (choice.finish === 'keep') return `Each page keeps its layout and every word as you wrote it, in your site’s own look. ${review}`;
|
|
400
|
+
if (options.generative && choice.wording) return `${PLATFORM_BRAND_NAME} AI redesigns each page and writes new copy from what your site says, making up no name, number, price or date. ${review}`;
|
|
346
401
|
return choice.wording ? `${PLATFORM_BRAND_NAME} AI redesigns each page and improves its wording, keeping every name, price, number, date, address, phone number and email as you wrote it. ${review}` : `${PLATFORM_BRAND_NAME} AI redesigns each page with its own words, pictures, menus and forms. ${review}`;
|
|
347
402
|
}
|
|
348
403
|
/**
|
|
@@ -372,5 +427,103 @@ const BUILD_COPY = {
|
|
|
372
427
|
wording: field.finish === 'improve' && field.wording
|
|
373
428
|
};
|
|
374
429
|
}
|
|
430
|
+
/** The panel's fixed words, one place for its specs and its screen. */ export const AI_SITE_IMPORT_PLAN_COPY_TEXT = {
|
|
431
|
+
heading: 'Your new site',
|
|
432
|
+
menu: 'Menu',
|
|
433
|
+
cta: 'Main button',
|
|
434
|
+
footer: 'Footer',
|
|
435
|
+
addPage: 'Add this new page',
|
|
436
|
+
addPageHelp: 'One new page, written from what your site says. It counts toward your plan’s page limit.',
|
|
437
|
+
pictures: 'Create pictures with AI where needed',
|
|
438
|
+
build: 'Build my new site',
|
|
439
|
+
whatsNew: 'What’s new'
|
|
440
|
+
};
|
|
441
|
+
/** The panel as a plan reads, or `null` with none: every import the flag is off for, and every plan that did not pass. */ export function aiSiteImportPlanViewOf(state) {
|
|
442
|
+
var _cta_page;
|
|
443
|
+
const plan = state == null ? void 0 : state.plan;
|
|
444
|
+
if (!state || !plan) return null;
|
|
445
|
+
const name = (id)=>{
|
|
446
|
+
var _ref;
|
|
447
|
+
var _plan_proposed, _state_pages_find;
|
|
448
|
+
return ((_plan_proposed = plan.proposed) == null ? void 0 : _plan_proposed.draftId) === id ? plan.proposed.title : (_ref = (_state_pages_find = state.pages.find((page)=>page.draftId === id)) == null ? void 0 : _state_pages_find.title) != null ? _ref : '';
|
|
449
|
+
};
|
|
450
|
+
const named = (groups)=>groups.map((group)=>({
|
|
451
|
+
label: group.label,
|
|
452
|
+
pages: group.pages.map(name).filter(Boolean)
|
|
453
|
+
})).filter((group)=>group.pages.length);
|
|
454
|
+
const cta = plan.nav.primaryCta;
|
|
455
|
+
const where = !cta ? '' : cta.target === 'phone' ? 'your phone number' : name(cta.target === 'form' ? (_cta_page = cta.page) != null ? _cta_page : '' : cta.target);
|
|
456
|
+
return {
|
|
457
|
+
what: plan.site.what,
|
|
458
|
+
audience: plan.site.audience,
|
|
459
|
+
menu: named(plan.nav.groups),
|
|
460
|
+
cta: cta && where ? `${cta.label} → ${where}` : null,
|
|
461
|
+
footer: named(plan.nav.footer),
|
|
462
|
+
proposed: plan.proposed && (aiSiteImportPlanAwaits(state) || plan.proposed.on) ? {
|
|
463
|
+
title: plan.proposed.title,
|
|
464
|
+
purpose: plan.proposed.purpose,
|
|
465
|
+
address: `/${plan.proposed.slug}`
|
|
466
|
+
} : null,
|
|
467
|
+
editable: aiSiteImportPlanAwaits(state)
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
/** What the plan that did not pass says, or `null`: a plan that passed, and every import with none asked. */ export function aiSiteImportPlanFellBackText(state) {
|
|
471
|
+
return (state == null ? void 0 : state.plan) === null ? AI_SITE_IMPORT_PLAN_FELL_BACK : null;
|
|
472
|
+
}
|
|
473
|
+
/** The credits a generated picture is quoted at, on a paid plan: an import is one. */ export const aiSiteImportPictureCredits = ()=>aiMediaCreditsPerPicture('photo', undefined, '1K');
|
|
474
|
+
/** What the generated pictures switch says it adds: how many at most, and what each costs, before it is on. */ export function aiSiteImportPicturesSwitchText(state) {
|
|
475
|
+
const pages = state.pages.filter((page)=>page.wording === 'improved' && !page.refused).length;
|
|
476
|
+
const each = aiSiteImportPictureCredits();
|
|
477
|
+
const most = pages * AI_SITE_IMPORT_GENERATED_PICTURES_PER_PAGE;
|
|
478
|
+
return `Only where your own photos and the stock library have nothing that fits: a page’s opening picture or a section’s lead, up to ${AI_SITE_IMPORT_GENERATED_PICTURES_PER_PAGE} a page. About ${each.toLocaleString('en-US')} AI credits each${most ? `, so at most ${(most * each).toLocaleString('en-US')} for this wave` : ''}. A picture that is not made costs nothing.`;
|
|
479
|
+
}
|
|
480
|
+
/** Whether generated pictures are switched on now, for the panel's first draw. */ export function aiSiteImportPlanFieldOf(state) {
|
|
481
|
+
var _state_plan_proposed, _state_plan;
|
|
482
|
+
return {
|
|
483
|
+
addPage: (state == null ? void 0 : (_state_plan = state.plan) == null ? void 0 : (_state_plan_proposed = _state_plan.proposed) == null ? void 0 : _state_plan_proposed.on) !== false,
|
|
484
|
+
pictures: aiSiteImportGeneratedPicturesOn(state)
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
/** Whether a plan's generated pictures switch means anything: only pages with new copy ask for a picture. */ export function aiSiteImportPlanTakesPictures(state) {
|
|
488
|
+
return state.pages.some((page)=>page.wording === 'improved' && !page.refused);
|
|
489
|
+
}
|
|
490
|
+
/** The wave's quote as the plan's switches stand now (AGL-4152), before they are saved: with or without its new page, and its pictures. */ export function aiSiteImportPlanQuote(job, field) {
|
|
491
|
+
var _job_siteImport, _job_items;
|
|
492
|
+
const state = (_job_siteImport = job.siteImport) != null ? _job_siteImport : null;
|
|
493
|
+
const plan = state == null ? void 0 : state.plan;
|
|
494
|
+
if (!state || !plan) return null;
|
|
495
|
+
const asked = _extends({}, state, {
|
|
496
|
+
generatedPictures: field.pictures,
|
|
497
|
+
plan: _extends({}, plan, {
|
|
498
|
+
proposed: plan.proposed ? _extends({}, plan.proposed, {
|
|
499
|
+
on: field.addPage
|
|
500
|
+
}) : null
|
|
501
|
+
})
|
|
502
|
+
});
|
|
503
|
+
const next = aiSiteImportPlanAccepted(asked, (_job_items = job.items) != null ? _job_items : []);
|
|
504
|
+
const wave = aiSiteImportRunningWave(next.state);
|
|
505
|
+
return wave ? aiSiteImportWaveQuote({
|
|
506
|
+
items: next.items,
|
|
507
|
+
siteImport: next.state
|
|
508
|
+
}, wave) : null;
|
|
509
|
+
}
|
|
510
|
+
/** A wave's "What's new" (AGL-4152): what its redesigns added, page by page. Empty on every other wave. */ export function aiSiteImportWhatsNew(state, wave) {
|
|
511
|
+
return wave.slots.flatMap((slot)=>{
|
|
512
|
+
var _aiSiteImportAddedText, _aiSiteImportPicturesText;
|
|
513
|
+
const page = state.pages.find((entry)=>entry.slot === slot);
|
|
514
|
+
if (!page || page.redesign !== 'redesigned') return [];
|
|
515
|
+
const lines = [
|
|
516
|
+
page.origin === 'proposed' ? 'A new page, written from what your site says' : '',
|
|
517
|
+
(_aiSiteImportAddedText = aiSiteImportAddedText(page)) != null ? _aiSiteImportAddedText : '',
|
|
518
|
+
(_aiSiteImportPicturesText = aiSiteImportPicturesText(page)) != null ? _aiSiteImportPicturesText : ''
|
|
519
|
+
].filter(Boolean);
|
|
520
|
+
return lines.length ? [
|
|
521
|
+
{
|
|
522
|
+
page: page.title,
|
|
523
|
+
lines
|
|
524
|
+
}
|
|
525
|
+
] : [];
|
|
526
|
+
});
|
|
527
|
+
}
|
|
375
528
|
|
|
376
529
|
//# sourceMappingURL=ai-site-import-view.js.map
|