refact: rename assets resource name

This commit is contained in:
pengfei.zhou 2021-12-07 19:13:42 +08:00 committed by osborn
parent 6dfe8b059f
commit f801aa64f8
8 changed files with 15 additions and 16 deletions

View File

@ -1,4 +1,4 @@
import { Base64Resource, Group, Panel, coordinator, text, gravity, Color, LayoutSpec, log, vlayout, scroller, layoutConfig, image, ScaleType, Image, modal, RemoteResource, MainBundleResource, AndroidAssetsResource, DoricAssetsResource } from "doric";
import { Base64Resource, Group, Panel, coordinator, text, gravity, Color, LayoutSpec, log, vlayout, scroller, layoutConfig, image, ScaleType, Image, modal, RemoteResource, MainBundleResource, AndroidAssetsResource, AssetsResource } from "doric";
import { colors, label } from "./utils";
import { img_base64 } from "./image_base64";
@ -6,7 +6,6 @@ const imageUrl = 'https://img.zcool.cn/community/01e75b5da933daa801209e1ffa4649.
import logo from "./images/logo_w.png"
import button from "./images/button.png"
import { DrawableResource } from "doric/lib/src/util/resource";
@Entry
class ImageDemo extends Panel {
@ -32,7 +31,7 @@ class ImageDemo extends Panel {
: new MainBundleResource("assets/The_Parthenon_in_Athens.jpeg"),
}),
image({
image: new DoricAssetsResource("The_Parthenon_in_Athens.jpeg"),
image: new AssetsResource("The_Parthenon_in_Athens.jpeg"),
}),
image({
image: new RemoteResource("https://p.upyun.com/demo/webp/webp/jpg-0.webp"),

View File

@ -2180,12 +2180,12 @@ var Base64Resource = /** @class */ (function (_super) {
/**
* Resources belong to assets dir.
*/
var DoricAssetsResource = /** @class */ (function (_super) {
__extends$f(DoricAssetsResource, _super);
function DoricAssetsResource(content) {
var AssetsResource = /** @class */ (function (_super) {
__extends$f(AssetsResource, _super);
function AssetsResource(content) {
return _super.call(this, "doric_assets", content) || this;
}
return DoricAssetsResource;
return AssetsResource;
}(Resource));
var AndroidResource = /** @class */ (function (_super) {
__extends$f(AndroidResource, _super);
@ -4525,6 +4525,7 @@ exports.AlphaAnimation = AlphaAnimation;
exports.AndroidAssetsResource = AndroidAssetsResource;
exports.AndroidResource = AndroidResource;
exports.AnimationSet = AnimationSet;
exports.AssetsResource = AssetsResource;
exports.BOTTOM = BOTTOM;
exports.BackgroundColorAnimation = BackgroundColorAnimation;
exports.Base64Resource = Base64Resource;
@ -4534,7 +4535,6 @@ exports.CENTER = CENTER;
exports.CENTER_X = CENTER_X;
exports.CENTER_Y = CENTER_Y;
exports.Color = Color;
exports.DoricAssetsResource = DoricAssetsResource;
exports.Draggable = Draggable;
exports.DrawableResource = DrawableResource;
exports.FlexLayout = FlexLayout;

View File

@ -1638,7 +1638,7 @@ class Base64Resource extends Resource {
/**
* Resources belong to assets dir.
*/
class DoricAssetsResource extends Resource {
class AssetsResource extends Resource {
constructor(content) {
super("doric_assets", content);
}
@ -3456,6 +3456,7 @@ exports.AlphaAnimation = AlphaAnimation;
exports.AndroidAssetsResource = AndroidAssetsResource;
exports.AndroidResource = AndroidResource;
exports.AnimationSet = AnimationSet;
exports.AssetsResource = AssetsResource;
exports.BOTTOM = BOTTOM;
exports.BackgroundColorAnimation = BackgroundColorAnimation;
exports.Base64Resource = Base64Resource;
@ -3465,7 +3466,6 @@ exports.CENTER = CENTER;
exports.CENTER_X = CENTER_X;
exports.CENTER_Y = CENTER_Y;
exports.Color = Color;
exports.DoricAssetsResource = DoricAssetsResource;
exports.Draggable = Draggable;
exports.DrawableResource = DrawableResource;
exports.FlexLayout = FlexLayout;

View File

@ -3166,7 +3166,7 @@ class Base64Resource extends Resource {
/**
* Resources belong to assets dir.
*/
class DoricAssetsResource extends Resource {
class AssetsResource extends Resource {
constructor(content) {
super("doric_assets", content);
}
@ -5225,6 +5225,7 @@ exports.AlphaAnimation = AlphaAnimation;
exports.AndroidAssetsResource = AndroidAssetsResource;
exports.AndroidResource = AndroidResource;
exports.AnimationSet = AnimationSet;
exports.AssetsResource = AssetsResource;
exports.BOTTOM = BOTTOM;
exports.BackgroundColorAnimation = BackgroundColorAnimation;
exports.Base64Resource = Base64Resource;
@ -5234,7 +5235,6 @@ exports.CENTER = CENTER;
exports.CENTER_X = CENTER_X;
exports.CENTER_Y = CENTER_Y;
exports.Color = Color;
exports.DoricAssetsResource = DoricAssetsResource;
exports.Draggable = Draggable;
exports.DrawableResource = DrawableResource;
exports.FlexLayout = FlexLayout;

2
doric-js/index.d.ts vendored
View File

@ -1693,7 +1693,7 @@ declare module 'doric/lib/src/util/resource' {
/**
* Resources belong to assets dir.
*/
export class DoricAssetsResource extends Resource {
export class AssetsResource extends Resource {
constructor(content: string);
}
export class AndroidResource extends Resource {

View File

@ -20,7 +20,7 @@ export declare class Base64Resource extends Resource {
/**
* Resources belong to assets dir.
*/
export declare class DoricAssetsResource extends Resource {
export declare class AssetsResource extends Resource {
constructor(content: string);
}
export declare class AndroidResource extends Resource {

View File

@ -28,7 +28,7 @@ export class Base64Resource extends Resource {
/**
* Resources belong to assets dir.
*/
export class DoricAssetsResource extends Resource {
export class AssetsResource extends Resource {
constructor(content) {
super("doric_assets", content);
}

View File

@ -35,7 +35,7 @@ export class Base64Resource extends Resource {
/**
* Resources belong to assets dir.
*/
export class DoricAssetsResource extends Resource {
export class AssetsResource extends Resource {
constructor(content: string) {
super("doric_assets", content)
}