autoblogger 0.2.27 → 0.2.29

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,16 @@ 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 params = {
7203
+ Bucket: config.bucket,
7204
+ Key: key,
7205
+ Body: buffer,
7206
+ ContentType: contentType
7207
+ };
7208
+ if (config.acl) {
7209
+ params.ACL = config.acl;
7210
+ }
7211
+ await client.send(new PutObjectCommand(params));
7196
7212
  const cdnEndpoint = config.cdnEndpoint || config.endpoint || `https://${config.bucket}.s3.${config.region || "us-east-1"}.amazonaws.com`;
7197
7213
  const url = cdnEndpoint.endsWith("/") ? `${cdnEndpoint}${key}` : `${cdnEndpoint}/${key}`;
7198
7214
  return { url, key };
@@ -8014,8 +8030,12 @@ var focus = (position = null, options = {}) => ({ editor, view, tr, dispatch })
8014
8030
  }
8015
8031
  });
8016
8032
  };
8017
- if (view.hasFocus() && position === null || position === false) {
8018
- return true;
8033
+ try {
8034
+ if (view.hasFocus() && position === null || position === false) {
8035
+ return true;
8036
+ }
8037
+ } catch {
8038
+ return false;
8019
8039
  }
8020
8040
  if (dispatch && position === null && !isTextSelection(editor.state.selection)) {
8021
8041
  delayedFocus();
@@ -8663,6 +8683,9 @@ function getAttributesFromExtensions(extensions) {
8663
8683
  keepOnSplit: true,
8664
8684
  isRequired: false
8665
8685
  };
8686
+ const nodeExtensionTypes = nodeExtensions.filter((ext) => ext.name !== "text").map((ext) => ext.name);
8687
+ const markExtensionTypes = markExtensions.map((ext) => ext.name);
8688
+ const allExtensionTypes = [...nodeExtensionTypes, ...markExtensionTypes];
8666
8689
  extensions.forEach((extension) => {
8667
8690
  const context = {
8668
8691
  name: extension.name,
@@ -8680,7 +8703,19 @@ function getAttributesFromExtensions(extensions) {
8680
8703
  }
8681
8704
  const globalAttributes = addGlobalAttributes();
8682
8705
  globalAttributes.forEach((globalAttribute) => {
8683
- globalAttribute.types.forEach((type) => {
8706
+ let resolvedTypes;
8707
+ if (Array.isArray(globalAttribute.types)) {
8708
+ resolvedTypes = globalAttribute.types;
8709
+ } else if (globalAttribute.types === "*") {
8710
+ resolvedTypes = allExtensionTypes;
8711
+ } else if (globalAttribute.types === "nodes") {
8712
+ resolvedTypes = nodeExtensionTypes;
8713
+ } else if (globalAttribute.types === "marks") {
8714
+ resolvedTypes = markExtensionTypes;
8715
+ } else {
8716
+ resolvedTypes = [];
8717
+ }
8718
+ resolvedTypes.forEach((type) => {
8684
8719
  Object.entries(globalAttribute.attributes).forEach(([name2, attribute]) => {
8685
8720
  extensionAttributes.push({
8686
8721
  type,
@@ -9101,6 +9136,9 @@ function isMarkActive(state, typeOrName, attributes = {}) {
9101
9136
  const from = $from.pos;
9102
9137
  const to = $to.pos;
9103
9138
  state.doc.nodesBetween(from, to, (node, pos) => {
9139
+ if (type && node.inlineContent && !node.type.allowsMarkType(type)) {
9140
+ return false;
9141
+ }
9104
9142
  if (!node.isText && !node.marks.length) {
9105
9143
  return;
9106
9144
  }
@@ -10485,6 +10523,39 @@ var ExtensionManager = class {
10485
10523
  };
10486
10524
  }, baseDispatch);
10487
10525
  }
10526
+ /**
10527
+ * Get the composed transformPastedHTML function from all extensions.
10528
+ * @param baseTransform The base transform function (e.g. from the editor props)
10529
+ * @returns A composed transform function that chains all extension transforms
10530
+ */
10531
+ transformPastedHTML(baseTransform) {
10532
+ const { editor } = this;
10533
+ const extensions = sortExtensions([...this.extensions]);
10534
+ return extensions.reduce(
10535
+ (transform, extension) => {
10536
+ const context = {
10537
+ name: extension.name,
10538
+ options: extension.options,
10539
+ storage: this.editor.extensionStorage[extension.name],
10540
+ editor,
10541
+ type: getSchemaTypeByName(extension.name, this.schema)
10542
+ };
10543
+ const extensionTransform = getExtensionField(
10544
+ extension,
10545
+ "transformPastedHTML",
10546
+ context
10547
+ );
10548
+ if (!extensionTransform) {
10549
+ return transform;
10550
+ }
10551
+ return (html, view) => {
10552
+ const transformedHtml = transform(html, view);
10553
+ return extensionTransform.call(context, transformedHtml);
10554
+ };
10555
+ },
10556
+ baseTransform || ((html) => html)
10557
+ );
10558
+ }
10488
10559
  get markViews() {
10489
10560
  const { editor } = this;
10490
10561
  const { markExtensions } = splitExtensions(this.extensions);