@blocklet/pages-kit 0.5.40 → 0.5.42

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.
@@ -1,6 +1,7 @@
1
1
  import { initSanitize } from '@blocklet/xss';
2
2
  import snakeCase from 'lodash/snakeCase';
3
3
  import * as yaml from 'yaml';
4
+ import { getMediaKitAbsoluteUrl } from '../builtin/utils';
4
5
  import { isBrowserEnv, COLOR_CONVERT_FUNCTION_NAME } from './common';
5
6
  export const sanitize = initSanitize();
6
7
  export function componentUMDName({ componentId }) {
@@ -155,6 +156,16 @@ export function parsePropertyValue(property, inputValue, { locale, defaultLocale
155
156
  },
156
157
  };
157
158
  }
159
+ if (property.type === 'url') {
160
+ if (value?.mediaKitUrl?.startsWith('mediakit://') && value?.url?.startsWith('mediakit://')) {
161
+ return {
162
+ url: getMediaKitAbsoluteUrl(value.mediaKitUrl) ?? getMediaKitAbsoluteUrl(value.url) ?? value.url,
163
+ mediaKitUrl: value.mediaKitUrl,
164
+ width: value.width,
165
+ height: value.height,
166
+ };
167
+ }
168
+ }
158
169
  return value;
159
170
  }
160
171
  export function assignNullableFields(properties, newProperties) {