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
2,407 changes: 1,293 additions & 1,114 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css",
"viewScript": "file:./view.js",
"render": "file:./render.php"
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
/**
* React hook that is used to mark the block wrapper element.
* It provides all the necessary props like the class name.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops
*/
import { useBlockProps } from '@wordpress/block-editor';

/**
* The save function defines the way in which the different attributes should
* be combined into the final markup, which is then serialized by the block
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
"textdomain": "mitlib-blocks",
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css",
"viewScript": "file:./view.js"
"style": "file:./style-index.css"
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/**
* Retrieves the translation of text.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/
*/
import { __ } from '@wordpress/i18n';
/**
* React hook that is used to mark the block wrapper element.
* It provides all the necessary props like the class name.
Expand Down Expand Up @@ -31,6 +25,6 @@ export default function Edit() {
return (
<div { ...useBlockProps() }>
<h2>Featured collection (No title to edit)</h2>
</div>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,40 @@ import { useBlockProps } from '@wordpress/block-editor';
* @return {Element} Element to render.
*/
export default function save() {
const blockProps = useBlockProps.save();

return (
<section id="featured-collection">
<div class="content-wrapper">
<div class="featured-collection-image" role="img" aria-label="Architectural elevation of a house with two gables and two chimneys by Howe, Manning and Almy Architects, dated 1927." style="background-image: url('https://libraries.mit.edu/app/uploads/2026/07/Howe-Manning-Almy-1.jpg');">
<span class="featured-collection-tag">Exhibit</span>
<section id="featured-collection" { ...blockProps }>
<div className="content-wrapper">
<div
className="featured-collection-image"
role="img"
aria-label="Architectural elevation of a house with two gables and two chimneys by Howe, Manning and Almy Architects, dated 1927."
style="background-image: url('https://libraries.mit.edu/app/uploads/2026/07/Howe-Manning-Almy-1.jpg');"
>
<span className="featured-collection-tag">Exhibit</span>
</div>
<div class="featured-collection-content">
<h2 class="sr">Featured Exhibit</h2>
<p class="eyebrow">Howe, Manning & Almy</p>
<h3>Boston's First All-Woman Firm and the Changing Face of Architecture</h3>
<p>Learn about the role MIT's architecture program played in supporting women in the field since the 1890s, Howe, Manning & Almy's influence on the built environment of Cambridge, and the firm's ecofriendly approaches to renovation.</p>
<a class="button secondary" title="Read more about the Howe, Manning & Almy exhibit" href="https://libraries.mit.edu/exhibits/exhibit/howe-manning-almy/">Check it out</a>
<div className="featured-collection-content">
<h2 className="sr">Featured Exhibit</h2>
<p className="eyebrow">Howe, Manning & Almy</p>
<h3>
Boston&apos;s First All-Woman Firm and the Changing Face
of Architecture
</h3>
<p>
Learn about the role MIT&apos;s architecture program
played in supporting women in the field since the 1890s,
Howe, Manning & Almy&apos;s influence on the built
environment of Cambridge, and the firm&apos;s
ecofriendly approaches to renovation.
</p>
<a
className="button secondary"
title="Read more about the Howe, Manning & Almy exhibit"
href="https://libraries.mit.edu/exhibits/exhibit/howe-manning-almy/"
>
Check it out
</a>
</div>
</div>
</section>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@
"editorScript": "file:./index.js",
"editorStyle": "file:./index.css",
"style": "file:./style-index.css",
"viewScript": "file:./view.js",
"render": "file:./render.php"
}
22 changes: 11 additions & 11 deletions web/app/plugins/mitlib-blocks/blocks/hero-section/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ import { useBlockProps, RichText } from '@wordpress/block-editor';
import './editor.scss';

export default function Edit( { attributes, setAttributes } ) {
const blockProps = useBlockProps();
const blockProps = useBlockProps();

return (
<div { ...blockProps }>
<RichText
tagName="h1"
value={ attributes.heading }
onChange={ ( heading ) => setAttributes( { heading } ) }
placeholder={ __( 'Enter heading…', 'mitlib-blocks' ) }
/>
</div>
);
return (
<div { ...blockProps }>
<RichText
tagName="h1"
value={ attributes.heading }
onChange={ ( heading ) => setAttributes( { heading } ) }
placeholder={ __( 'Enter heading…', 'mitlib-blocks' ) }
/>
</div>
);
}
10 changes: 1 addition & 9 deletions web/app/plugins/mitlib-blocks/blocks/hero-section/save.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
/**
* React hook that is used to mark the block wrapper element.
* It provides all the necessary props like the class name.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops
*/
import { useBlockProps } from '@wordpress/block-editor';

/**
* The save function defines the way in which the different attributes should
* be combined into the final markup, which is then serialized by the block
Expand All @@ -16,5 +8,5 @@ import { useBlockProps } from '@wordpress/block-editor';
* @return {Element} Element to render.
*/
export default function save() {
return null;
return null;
}
25 changes: 0 additions & 25 deletions web/app/plugins/mitlib-blocks/blocks/hero-section/view.js

This file was deleted.

64 changes: 37 additions & 27 deletions web/app/plugins/mitlib-blocks/blocks/hours-section/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/
*/
import { __ } from '@wordpress/i18n';
import { useBlockProps, RichText, InspectorControls } from '@wordpress/block-editor';
import {
useBlockProps,
RichText,
InspectorControls,
} from '@wordpress/block-editor';
import { PanelBody, TextControl } from '@wordpress/components';
import './editor.scss';

Expand All @@ -13,32 +17,38 @@ export default function Edit( { attributes, setAttributes } ) {

return (
<>
<InspectorControls>
<PanelBody title={ __( 'Link Settings', 'mitlib-blocks' ) }>
<TextControl
label={ __( 'Link text', 'mitlib-blocks' ) }
value={ linkText }
onChange={ ( value ) => setAttributes( { linkText: value } ) }
/>
<TextControl
label={ __( 'Link URL', 'mitlib-blocks' ) }
value={ linkUrl }
onChange={ ( value ) => setAttributes( { linkUrl: value } ) }
type="url"
/>
</PanelBody>
</InspectorControls>
<section { ...useBlockProps() } id="todays-hours">
<div className="content-wrapper">
<RichText
tagName="h2"
value={ heading }
onChange={ ( value ) => setAttributes( { heading: value } ) }
placeholder={ __( 'Today\'s hours', 'mitlib-blocks' ) }
allowedFormats={ [] }
/>
</div>
</section>
<InspectorControls>
<PanelBody title={ __( 'Link Settings', 'mitlib-blocks' ) }>
<TextControl
label={ __( 'Link text', 'mitlib-blocks' ) }
value={ linkText }
onChange={ ( value ) =>
setAttributes( { linkText: value } )
}
/>
<TextControl
label={ __( 'Link URL', 'mitlib-blocks' ) }
value={ linkUrl }
onChange={ ( value ) =>
setAttributes( { linkUrl: value } )
}
type="url"
/>
</PanelBody>
</InspectorControls>
<section { ...useBlockProps() } id="todays-hours">
<div className="content-wrapper">
<RichText
tagName="h2"
value={ heading }
onChange={ ( value ) =>
setAttributes( { heading: value } )
}
placeholder={ __( "Today's hours", 'mitlib-blocks' ) }
allowedFormats={ [] }
/>
</div>
</section>
</>
);
}
Loading
Loading