Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions BREAKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This is a comprehensive list of the breaking changes introduced in the major ver
- [Chip](#version-9x-chip)
- [Datetime](#version-9x-datetime)
- [Grid](#version-9x-grid)
- [Image](#version-9x-image)
- [Input Otp](#version-9x-input-otp)
- [Item Divider](#version-9x-item-divider)
- [Radio Group](#version-9x-radio-group)
Expand Down Expand Up @@ -202,6 +203,16 @@ To reorder two columns where column 1 has `size="9" push="3"` and column 2 has `
</ion-grid>
```

<h4 id="version-9x-image">Image</h4>

The following breaking changes apply to `ion-img`:

1. Theme classes (`ion-img.md`, `ion-img.ios`) are no longer supported.

<h5>Theme classes</h5>

Remove any instances that target the theme classes: `ion-img.md`, `ion-img.ios`.

<h4 id="version-9x-input-otp">Input Otp</h4>

Converted `ion-input-otp` to use [Shadow DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM).
Expand Down
1 change: 0 additions & 1 deletion core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,6 @@ ion-img,shadow
ion-img,prop,alt,string | undefined,undefined,false,false
ion-img,prop,mode,"ios" | "md",undefined,false,false
ion-img,prop,src,string | undefined,undefined,false,false
ion-img,prop,theme,"ios" | "md" | "ionic",undefined,false,false
ion-img,event,ionError,void,true
ion-img,event,ionImgDidLoad,void,true
ion-img,event,ionImgWillLoad,void,true
Expand Down
1 change: 1 addition & 0 deletions core/scripts/vercel-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ echo "Copying core output..."
cp -r "${CORE_DIR}/src" "${OUTPUT_DIR}/src"
cp -r "${CORE_DIR}/dist" "${OUTPUT_DIR}/dist"
cp -r "${CORE_DIR}/css" "${OUTPUT_DIR}/css"
cp -r "${CORE_DIR}/themes" "${OUTPUT_DIR}/themes"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The themes/ directory (generated by npm run build.themes and dynamically imported by scripts.js at runtime as /themes/{theme}/default.tokens.js) wasn't being copied into the Vercel output, so the token modules 404'd in deployed previews while working fine locally where the dev server serves it from core/.

mkdir -p "${OUTPUT_DIR}/scripts"
cp -r "${CORE_DIR}/scripts/testing" "${OUTPUT_DIR}/scripts/testing"

Expand Down
8 changes: 0 additions & 8 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1525,10 +1525,6 @@ export namespace Components {
* The image URL. This attribute is mandatory for the `<img>` element.
*/
"src"?: string;
/**
* The theme determines the visual appearance of the component.
*/
"theme"?: "ios" | "md" | "ionic";
}
interface IonInfiniteScroll {
/**
Expand Down Expand Up @@ -7525,10 +7521,6 @@ declare namespace LocalJSX {
* The image URL. This attribute is mandatory for the `<img>` element.
*/
"src"?: string;
/**
* The theme determines the visual appearance of the component.
*/
"theme"?: "ios" | "md" | "ionic";
}
interface IonInfiniteScroll {
/**
Expand Down
10 changes: 1 addition & 9 deletions core/src/components/img/img.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import { Component, Element, Event, Host, Prop, State, Watch, h } from '@stencil
import type { Attributes } from '@utils/helpers';
import { inheritAttributes } from '@utils/helpers';

import { getIonTheme } from '../../global/ionic-global';

/**
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
*
* @part image - The inner `img` element.
*/
Expand Down Expand Up @@ -124,13 +121,8 @@ export class Img implements ComponentInterface {
render() {
const { loadSrc, alt, onLoad, loadError, inheritedAttributes } = this;
const { draggable } = inheritedAttributes;
const theme = getIonTheme(this);
return (
<Host
class={{
[theme]: true,
}}
>
<Host>
<img
decoding="async"
src={loadSrc}
Expand Down
4 changes: 2 additions & 2 deletions packages/angular/src/directives/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -891,14 +891,14 @@ export declare interface IonIcon extends Components.IonIcon {}


@ProxyCmp({
inputs: ['alt', 'mode', 'src', 'theme']
inputs: ['alt', 'mode', 'src']
})
@Component({
selector: 'ion-img',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['alt', 'mode', 'src', 'theme'],
inputs: ['alt', 'mode', 'src'],
})
export class IonImg {
protected el: HTMLIonImgElement;
Expand Down
4 changes: 2 additions & 2 deletions packages/angular/standalone/src/directives/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -914,14 +914,14 @@ export declare interface IonHeader extends Components.IonHeader {}

@ProxyCmp({
defineCustomElementFn: defineIonImg,
inputs: ['alt', 'mode', 'src', 'theme']
inputs: ['alt', 'mode', 'src']
})
@Component({
selector: 'ion-img',
changeDetection: ChangeDetectionStrategy.OnPush,
template: '<ng-content></ng-content>',
// eslint-disable-next-line @angular-eslint/no-inputs-metadata-property
inputs: ['alt', 'mode', 'src', 'theme'],
inputs: ['alt', 'mode', 'src'],
standalone: true
})
export class IonImg {
Expand Down
Loading