autoblogger 0.2.28 → 0.2.30

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/index.d.mts CHANGED
@@ -773,6 +773,7 @@ interface StorageConfig {
773
773
  region?: string;
774
774
  endpoint?: string;
775
775
  cdnEndpoint?: string;
776
+ acl?: string;
776
777
  };
777
778
  local?: {
778
779
  uploadDir?: string;
package/dist/index.d.ts CHANGED
@@ -773,6 +773,7 @@ interface StorageConfig {
773
773
  region?: string;
774
774
  endpoint?: string;
775
775
  cdnEndpoint?: string;
776
+ acl?: string;
776
777
  };
777
778
  local?: {
778
779
  uploadDir?: string;
package/dist/index.js CHANGED
@@ -308,7 +308,7 @@ var init_package = __esm({
308
308
  "node_modules/@prismicio/client/dist/package.js"() {
309
309
  "use strict";
310
310
  name = "@prismicio/client";
311
- version = "7.21.3";
311
+ version = "7.21.6";
312
312
  }
313
313
  });
314
314
 
@@ -412,7 +412,7 @@ var init_getRepositoryName = __esm({
412
412
  getRepositoryName = (repositoryEndpoint) => {
413
413
  try {
414
414
  const hostname = new URL(repositoryEndpoint).hostname;
415
- if (hostname.endsWith("prismic.io") || hostname.endsWith("wroom.io") || hostname.endsWith("wroom.test")) return hostname.split(".")[0];
415
+ if (hostname.endsWith("prismic.io") || hostname.endsWith("wroom.io") || hostname.endsWith("dev-tools-wroom.com") || hostname.endsWith("marketing-tools-wroom.com") || hostname.endsWith("platform-wroom.com") || hostname.endsWith("wroom.test")) return hostname.split(".")[0];
416
416
  } catch {
417
417
  }
418
418
  throw new PrismicError(`An invalid Prismic Document API endpoint was provided: ${repositoryEndpoint}`, void 0, void 0);
@@ -510,6 +510,20 @@ var init_pLimit = __esm({
510
510
  });
511
511
 
512
512
  // node_modules/@prismicio/client/dist/lib/request.js
513
+ async function memoizeResponse(response) {
514
+ const blob = await response.blob();
515
+ const memoized = {
516
+ ok: response.ok,
517
+ status: response.status,
518
+ headers: response.headers,
519
+ url: response.url,
520
+ text: async () => blob.text(),
521
+ json: async () => JSON.parse(await blob.text()),
522
+ blob: async () => blob,
523
+ clone: () => memoized
524
+ };
525
+ return memoized;
526
+ }
513
527
  async function request(url, init, fetchFn) {
514
528
  const stringURL = url.toString();
515
529
  let job;
@@ -521,7 +535,7 @@ async function request(url, init, fetchFn) {
521
535
  const existingJob = (_DEDUPLICATED_JOBS$st = DEDUPLICATED_JOBS[stringURL]) === null || _DEDUPLICATED_JOBS$st === void 0 ? void 0 : _DEDUPLICATED_JOBS$st.get(init === null || init === void 0 ? void 0 : init.signal);
522
536
  if (existingJob) job = existingJob;
523
537
  else {
524
- job = fetchFn(stringURL, init).finally(() => {
538
+ job = fetchFn(stringURL, init).then(memoizeResponse).finally(() => {
525
539
  var _DEDUPLICATED_JOBS$st2, _DEDUPLICATED_JOBS$st3;
526
540
  (_DEDUPLICATED_JOBS$st2 = DEDUPLICATED_JOBS[stringURL]) === null || _DEDUPLICATED_JOBS$st2 === void 0 || _DEDUPLICATED_JOBS$st2.delete(init === null || init === void 0 ? void 0 : init.signal);
527
541
  if (((_DEDUPLICATED_JOBS$st3 = DEDUPLICATED_JOBS[stringURL]) === null || _DEDUPLICATED_JOBS$st3 === void 0 ? void 0 : _DEDUPLICATED_JOBS$st3.size) === 0) delete DEDUPLICATED_JOBS[stringURL];
@@ -536,7 +550,7 @@ async function request(url, init, fetchFn) {
536
550
  await new Promise((resolve) => setTimeout(resolve, resolvedRetryAfter));
537
551
  return request(url, init, fetchFn);
538
552
  }
539
- return response.clone();
553
+ return response;
540
554
  }
541
555
  var DEFAULT_RETRY_AFTER, THROTTLED_RUNNERS, DEDUPLICATED_JOBS;
542
556
  var init_request = __esm({
@@ -676,7 +690,7 @@ var init_Client = __esm({
676
690
  if (!isRepositoryEndpoint(this.documentAPIEndpoint)) throw new PrismicError(`documentAPIEndpoint is not a valid URL: ${documentAPIEndpoint}`, void 0, void 0);
677
691
  if (isRepositoryEndpoint(repositoryNameOrEndpoint) && documentAPIEndpoint && repositoryNameOrEndpoint !== documentAPIEndpoint) console.warn(`[@prismicio/client] Multiple incompatible endpoints were provided. Create the client using a repository name to prevent this error. For more details, see ${devMsg("prefer-repository-name")}`);
678
692
  if (process.env.NODE_ENV === "development" && /\.prismic\.io\/(?!api\/v2\/?)/i.test(this.documentAPIEndpoint)) throw new PrismicError("@prismicio/client only supports Prismic Rest API V2. Please provide only the repository name to the first createClient() parameter or use the getRepositoryEndpoint() helper to generate a valid Rest API V2 endpoint URL.", void 0, void 0);
679
- if (process.env.NODE_ENV === "development" && /(?<!\.cdn)\.prismic\.io$/i.test(new URL(this.documentAPIEndpoint).hostname)) console.warn(`[@prismicio/client] The client was created with a non-CDN endpoint. Convert it to the CDN endpoint for better performance. For more details, see ${devMsg("endpoint-must-use-cdn")}`);
693
+ if (process.env.NODE_ENV === "development" && /\.prismic\.io$/i.test(new URL(this.documentAPIEndpoint).hostname) && !/\.cdn\.prismic\.io$/i.test(new URL(this.documentAPIEndpoint).hostname)) console.warn(`[@prismicio/client] The client was created with a non-CDN endpoint. Convert it to the CDN endpoint for better performance. For more details, see ${devMsg("endpoint-must-use-cdn")}`);
680
694
  this.accessToken = accessToken;
681
695
  this.routes = routes;
682
696
  this.brokenRoute = brokenRoute;
@@ -7159,6 +7173,7 @@ async function getS3Client(config) {
7159
7173
  return new S3Client({
7160
7174
  region: config.region || "us-east-1",
7161
7175
  endpoint: config.endpoint,
7176
+ forcePathStyle: false,
7162
7177
  credentials: {
7163
7178
  accessKeyId: config.accessKeyId,
7164
7179
  secretAccessKey: config.secretAccessKey
@@ -7184,15 +7199,17 @@ async function uploadToS3(buffer, filename, contentType, config) {
7184
7199
  const client = await getS3Client(config);
7185
7200
  const ext = filename.split(".").pop()?.toLowerCase() || "jpg";
7186
7201
  const key = `uploads/${(0, import_crypto.randomUUID)()}.${ext}`;
7187
- await client.send(
7188
- new PutObjectCommand({
7189
- Bucket: config.bucket,
7190
- Key: key,
7191
- Body: buffer,
7192
- ContentType: contentType,
7193
- ACL: "public-read"
7194
- })
7195
- );
7202
+ const acl = config.acl !== void 0 ? config.acl : "public-read";
7203
+ const params = {
7204
+ Bucket: config.bucket,
7205
+ Key: key,
7206
+ Body: buffer,
7207
+ ContentType: contentType
7208
+ };
7209
+ if (acl) {
7210
+ params.ACL = acl;
7211
+ }
7212
+ await client.send(new PutObjectCommand(params));
7196
7213
  const cdnEndpoint = config.cdnEndpoint || config.endpoint || `https://${config.bucket}.s3.${config.region || "us-east-1"}.amazonaws.com`;
7197
7214
  const url = cdnEndpoint.endsWith("/") ? `${cdnEndpoint}${key}` : `${cdnEndpoint}/${key}`;
7198
7215
  return { url, key };
@@ -8014,8 +8031,12 @@ var focus = (position = null, options = {}) => ({ editor, view, tr, dispatch })
8014
8031
  }
8015
8032
  });
8016
8033
  };
8017
- if (view.hasFocus() && position === null || position === false) {
8018
- return true;
8034
+ try {
8035
+ if (view.hasFocus() && position === null || position === false) {
8036
+ return true;
8037
+ }
8038
+ } catch {
8039
+ return false;
8019
8040
  }
8020
8041
  if (dispatch && position === null && !isTextSelection(editor.state.selection)) {
8021
8042
  delayedFocus();
@@ -8663,6 +8684,9 @@ function getAttributesFromExtensions(extensions) {
8663
8684
  keepOnSplit: true,
8664
8685
  isRequired: false
8665
8686
  };
8687
+ const nodeExtensionTypes = nodeExtensions.filter((ext) => ext.name !== "text").map((ext) => ext.name);
8688
+ const markExtensionTypes = markExtensions.map((ext) => ext.name);
8689
+ const allExtensionTypes = [...nodeExtensionTypes, ...markExtensionTypes];
8666
8690
  extensions.forEach((extension) => {
8667
8691
  const context = {
8668
8692
  name: extension.name,
@@ -8680,7 +8704,19 @@ function getAttributesFromExtensions(extensions) {
8680
8704
  }
8681
8705
  const globalAttributes = addGlobalAttributes();
8682
8706
  globalAttributes.forEach((globalAttribute) => {
8683
- globalAttribute.types.forEach((type) => {
8707
+ let resolvedTypes;
8708
+ if (Array.isArray(globalAttribute.types)) {
8709
+ resolvedTypes = globalAttribute.types;
8710
+ } else if (globalAttribute.types === "*") {
8711
+ resolvedTypes = allExtensionTypes;
8712
+ } else if (globalAttribute.types === "nodes") {
8713
+ resolvedTypes = nodeExtensionTypes;
8714
+ } else if (globalAttribute.types === "marks") {
8715
+ resolvedTypes = markExtensionTypes;
8716
+ } else {
8717
+ resolvedTypes = [];
8718
+ }
8719
+ resolvedTypes.forEach((type) => {
8684
8720
  Object.entries(globalAttribute.attributes).forEach(([name2, attribute]) => {
8685
8721
  extensionAttributes.push({
8686
8722
  type,
@@ -9101,6 +9137,9 @@ function isMarkActive(state, typeOrName, attributes = {}) {
9101
9137
  const from = $from.pos;
9102
9138
  const to = $to.pos;
9103
9139
  state.doc.nodesBetween(from, to, (node, pos) => {
9140
+ if (type && node.inlineContent && !node.type.allowsMarkType(type)) {
9141
+ return false;
9142
+ }
9104
9143
  if (!node.isText && !node.marks.length) {
9105
9144
  return;
9106
9145
  }
@@ -10485,6 +10524,39 @@ var ExtensionManager = class {
10485
10524
  };
10486
10525
  }, baseDispatch);
10487
10526
  }
10527
+ /**
10528
+ * Get the composed transformPastedHTML function from all extensions.
10529
+ * @param baseTransform The base transform function (e.g. from the editor props)
10530
+ * @returns A composed transform function that chains all extension transforms
10531
+ */
10532
+ transformPastedHTML(baseTransform) {
10533
+ const { editor } = this;
10534
+ const extensions = sortExtensions([...this.extensions]);
10535
+ return extensions.reduce(
10536
+ (transform, extension) => {
10537
+ const context = {
10538
+ name: extension.name,
10539
+ options: extension.options,
10540
+ storage: this.editor.extensionStorage[extension.name],
10541
+ editor,
10542
+ type: getSchemaTypeByName(extension.name, this.schema)
10543
+ };
10544
+ const extensionTransform = getExtensionField(
10545
+ extension,
10546
+ "transformPastedHTML",
10547
+ context
10548
+ );
10549
+ if (!extensionTransform) {
10550
+ return transform;
10551
+ }
10552
+ return (html, view) => {
10553
+ const transformedHtml = transform(html, view);
10554
+ return extensionTransform.call(context, transformedHtml);
10555
+ };
10556
+ },
10557
+ baseTransform || ((html) => html)
10558
+ );
10559
+ }
10488
10560
  get markViews() {
10489
10561
  const { editor } = this;
10490
10562
  const { markExtensions } = splitExtensions(this.extensions);